Hi All,
I went through code of a project and i observe that a odbc adapter fill dataset sucessfully but connection is closed or only connection string provided.
I am confuse how it work , I think connection should be open other wise exception should be throw.
Kindly clear my confusion.
Below are the code: -
Dim dbconn As Odbc.OdbcConnection
dbconn = New Odbc.OdbcConnection(connectionstring)
If dbconn.State <> ConnectionState.Open Then
dbconn.Open()
End If
dbconn.Close()
Dim dbAdapter As Odbc.OdbcDataAdapter
dbAdapter = New Odbc.OdbcDataAdapter("select * from studdent where id=5", dbconn)
Dim ds As New DataSet
dbAdapter.Fill(ds)
Arun KuamrPosted Apr 14, 2016, 8:47 AM
Chandu KumawatPosted Apr 14, 2016, 8:43 AM
Arun KuamrPosted Apr 14, 2016, 8:42 AM
Arun KuamrPosted Apr 14, 2016, 8:38 AM
Chandu KumawatPosted Apr 14, 2016, 8:38 AM
Ranjit PowarPosted Apr 14, 2016, 8:06 AM