ADO.NET issues

fkheng

Well-known member
Joined
May 8, 2003
Messages
155
Location
Malaysia
In order for me to work with data components or other ado.net related code, wat references are necessary for me to proceed with the coding?
 
plus:
System.Data.OleDb
System.Data.SqlClient
depending on whether your connecting to SQL Server or something else.
 
i see...
i did add a reference for System.Data.Dll

but my OleDb syntax were still underlined in blue
so i just typed Imports System.Data.OleDb and it worked...

i tot as long as i added the System.Data reference it should have covered the OleDb references as well, shouldnt it?
 
It would have added the reference to the project but you would still have to specify the full class name (including namespace)

so the OleDBConnection is really System.Data.OleDB.OleDBConnection

Imports System.Data.OleDb is just a shorthand way of accessing those classes.
 
i see
so though ive added the reference System.Data
i still have to im port System.Data.OleDb eh?

wat if i just type Imports System.Data
would that suffice? or must i still specify System.Data.OleDb just becoz im using the OleDb data provider?
 
You have to import it.
And if you import only System.Data you will have to do more typing.
Better you also import System.Data.OleDb (or SqlClient)
 
another question
each time after using a data adapter to fill in a data set, they always have something which has a .setdatabinding, something like that, wat is the name of the object which does this operation? and wats the purpose?
 
This is for binding data to controls.
For more information browse the objectcatalog and display help for the control.databindings.
 
Back
Top