Results 1 to 3 of 3

Thread: in vb.net programming, do we need to use lot of IDBConnection or IDBadapter..

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2003
    Posts
    436

    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

  2. #2
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861
    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

  3. #3
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    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
  •  



Click Here to Expand Forum to Full Width