|
-
Nov 28th, 2003, 04:48 PM
#1
Thread Starter
Hyperactive Member
in vb.net programming, do we need to use lot of IDBConnection or IDBadapter..
can't we get away without using them?
I downloaded code from http://www.vbdotnetheaven.com/Code/Jun2003/2044.asp
He has written a generic data access class which return IDBconnection and IDBAdapter interfaces (i guess???)
basically I am able to connect to the database in either of the following ways...
dim cnconnection as sqlconnection
dim idbcon as IDBConnection
cnConnection = New SqlConnection("server=vaio;Trusted_Connection=yes;database=northwind")
idbcon = New SqlConnection("server=vaio;Trusted_Connection=yes;database=northwind")
I am getting confused about IDBCOnnection...
any thoughts when it would be of help?
thanks
-
Nov 28th, 2003, 05:26 PM
#2
Frenzied Member
Yes, it isn't necessary to work with the IDB interfaces..That is why they have the SqlConnection, OleDbConnection, and OdbcConnection these data classes implement those interfaces for you.
Being educated does not make you intelligent.
Need a weekend getaway??? Come Visit
-
Nov 28th, 2003, 09:15 PM
#3
Well it depends what you want. If you know what kind of connection will be used (SQL,ODBC,OLEDB) then just use the normal objects for each. The Interfaces are useful for when you don't know, its called polymorphic behavior. If you want the data to be used with all data objects then you would use the interfaces.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|