Public oDataSet As DataSet = Nothing Private oCommand As IDbCommand = Nothing Private oDataAdapter As IDbDataAdapter = NothingBased on the backend, I have this:
' Different backends handle it differently Select Case nSQLMode ' OleDb Case 1 oDataAdapter = New OleDbDataAdapter oCommand = New OleDbCommand ' SQLClient Case 2 oDataAdapter = New SqlDataAdapter oCommand = New SqlCommand ' ODBC Case 3 oDataAdapter = New OdbcDataAdapter oCommand = New OdbcCommand End SelectSome initializations:
oCommand.CommandText = tcSQL oDataAdapter.SelectCommand = oCommand oDataSet = New DataSetThis is where the query happens:
Using loSQLConnection As New SqlConnection(lcConnectionString) oCommand.Connection = loSQLConnection oDataAdapter.Fill(oDataSet) End Using