You are here:About>Computing & Technology>Visual Basic
About.comVisual Basic
Using ADO .NET - First Principles
Part 2: Using ADO. NET in Visual Studio .NET

The ADO .NET namespace is in System.Data.dll. The default Windows Application project already adds a reference to that DLL, but it's worthwhile to make sure that it's there on your computer.

System.Data Reference


 More of this Feature
• Part 1: Learning ADO .NET
• Part 3: DataSet - King of ADO .NET Objects
• Part 4: The Xtra in ADO is XML!
 
 Join the Discussion
Is this the kind of article that helps you?
Let us know!
 
 Related Resources
• VB .NET Books!
• New to VB .NET?
  Learn It Here!
 
 Elsewhere on the Web
• About.Com DATABASES
 

Once you're certain that the reference to the DLL is present, it's also a good idea to add an Imports statement for System.Data.OleDb, System.Data.SqlClient or other namespace to your project to make it easier to write correct code. (These will be discussed in later articles in this series.) There is so much confusion on this point that a special DYK article has been written for this tutorial to make sure you understand it. If you have any questions at all about what the Imports statement does, read through this DYK carefully.

The objects that are in ADO .NET are roughly split into two groups — content components and managed-provider components. The content components essentially hold actual data and include these classes:

  • DataSet
  • DataTable
  • DataView
  • DataRow
  • DataColumn
  • DataRelation

The managed-provider components interact with the database for data retrievals and updates. These components include:

  • connection
  • command
  • data adapter
  • data reader

The names above are "generic" (note that they're not capitalized) because unique managed-provider components are used with different "providers" (software interfaces for actual databases). There are two that are currently included with ADO .NET. SqlClient is used with Microsoft's SQL Server database and OleDb for everything else. For example, SqlClient contains SqlDataReader and OleDb contains OleDbDataReader.

Right now, only SQL Server has native support through an ADO .NET managed provider. But since there is a lot of data in other data sources, Microsoft has supplied an ADO .NET managed provider for OLE DB (in the System.Data.OleDb namespace). If a data source has OLE DB data provider, ADO .NET can work with it. Since there is an OLE DB provider that wraps the even older ODBC, ADO .NET can work with almost all legacy data, regardless of the source.

Next page > DataSet - King of ADO .NET Objects > Page 1, 2, 3, 4
From Dan Mabbutt,
Your Guide to Visual Basic.
FREE Newsletter. Sign Up Now!
Newsletters & RSSEmail to a friendSubmit to Digg
 All Topics | Email Article | | |
Advertising Info | News & Events | Work at About | SiteMap | Reprints | HelpOur Story | Be a Guide
User Agreement | Ethics Policy | Patent Info. | Privacy Policy©2008 About, Inc., A part of The New York Times Company. All rights reserved.