> Public oDataSet As DataSet = Nothing > Private oCommand As IDbCommand = Nothing > Private oDataAdapter As IDbDataAdapter = Nothing >>
> ' 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 Select >>
> oCommand.CommandText = tcSQL > oDataAdapter.SelectCommand = oCommand > > oDataSet = New DataSet >>
> Using loSQLConnection As New SqlConnection(lcConnectionString) > oCommand.Connection = loSQLConnection > oDataAdapter.Fill(oDataSet) > End Using >Do you usually close the connection? And if yes, how? The last segment of your code shows that you call Fill() method to fill the dataset. But this, if I understand correctly, leaves the connection open. How do you deal with this?