Congratulations - C# Corner Q4, 2022 MVPs Announced
Why Join
Become a member
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
C# Corner Home
Technologies
Monthly Leaders
ASK A QUESTION
Forum guidelines
Arun Kuamr
2.1k
56
2.5k
odbc connectivity
Apr 14 2016 7:58 AM
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)
Reply
Answers (
6
)
LINQ Queries
save