Dim ds As New DataSet
If DatabaseToUse() = BizObjs.DBType.Access Then
'Access Database
Dim dc As New OleDb.OleDbConnection(ConnectionString)
Dim cmd As New OleDb.OleDbCommand("Select * from Company", dc)
Try
dc.Open()
Dim dr As OleDbDataReader = cmd.ExecuteReader()
If dr.HasRows Then
CompanyID = dr("CompanyID")
CompanyName = dr("CompanyName")
Add1 = dr("Address1")
Add2 = dr("Address2")
City = dr("CityName")
StateID = dr("StateID")
Postal = dr("Postal")
CntryID = dr("CntryID")
DefaultStateID = dr("DefaultStateID")
DefaultCntryID = dr("DefaultCntryID")
End If
dr.Close()
Catch ex As Exception
MessageBox.Show(ex.Message)
Throw ex
Finally
dc.Close()
End Try
End If
Dim ds As New DataSet
If DatabaseToUse() = BizObjs.DBType.Access Then
'Access Database
Dim dc As New OleDb.OleDbConnection(ConnectionString)
Dim cmd As New OleDb.OleDbCommand("Select * from Company", dc)
Try
dc.Open()
Dim dr As OleDbDataReader = cmd.ExecuteReader()
While objDR.Read()
CompanyID = dr("CompanyID")
CompanyName = dr("CompanyName")
Add1 = dr("Address1")
Add2 = dr("Address2")
City = dr("CityName")
StateID = dr("StateID")
Postal = dr("Postal")
CntryID = dr("CntryID")
DefaultStateID = dr("DefaultStateID")
DefaultCntryID = dr("DefaultCntryID")
Exit While
End While
dr.Close()
Catch ex As Exception
MessageBox.Show(ex.Message)
Throw ex
Finally
dc.Close()
End Try
End If
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
From novice to tech pro — start learning today.
Open in new window