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)

Ranjit PowarRank #553 · 4.4K reputationPosted Apr 14, 2016, 4:06 AM EDT
Chandu KumawatRank #1,449 · 1.1K reputationPosted Apr 14, 2016, 4:38 AM EDT
Arun Kuamr57 reputationPosted Apr 14, 2016, 4:38 AM EDT
Arun Kuamr57 reputationPosted Apr 14, 2016, 4:42 AM EDT
Chandu KumawatRank #1,449 · 1.1K reputationPosted Apr 14, 2016, 4:43 AM EDT
Arun Kuamr57 reputationPosted Apr 14, 2016, 4:47 AM EDT