Introduction to ADO.NET


Microsoft SQL Server and Visual Studio 2005



Microsoft SQL Server is mainly used to create and maintain computer databases. It does not provide the means of creating graphical elements that would make it easy for a regular user to take advantage of its lists. To create an application made of graphical user interface (GUI) objects, you must use a separate environment. To make this easy, Microsoft created a very direct link between Microsoft Visual Studio and Microsoft SQL Server. The communication is so smooth that, from Microsoft Visual Studio, you can use Microsoft SQL Server directly without having to formally open SQL Server.


Introduction to ADO.NET

ADO.NET is a group of libraries used to create powerful databases using various sources that include Microsoft SQL Server, Microsoft Access, Oracle, XML, etc. ADO.NET relies on the .NET Framework's various classes to process requests and perform the transition between a database system and the user. The operations are typically handled through the DataSet class.

While ADO.NET is the concept of creating and managing database systems, the DataSet class, as we have introduced it so far, serves as an intermediary between the database engine and the user interface, namely the Windows controls that the user uses to interact with the computer. Still, remember that a DataSet object is used to manage lists, any lists, not just those created using database environments such as Microsoft SQL Server or Microsoft Access.

Besides using features of a database in an ADO.NET application, you can also fully take advantage of XML as it is completely and inherently supported by the DataSet class. To fully support XML in your application, we saw in previous lessons that the .NET Framework is equipped with the System.Xml.dll library. You may have noticed that, in previously lessons, to use XML, we never had to import any library. This was possible because, if you create a Windows Application using the New Project dialog box, the System.Xml.dll namespace is directly included in your application.

Getting Access to ADO.NET Libraries

The classes used to create ADO.NET databases are defined in the System.Data namespace and are stored in the System.Data.dll library. If you create a Windows Application from the New Project dialog box, Microsoft Visual Studio would automatically include the System.Data.dll library and add the System.Data namespace to your project, even if you are not creating a database application. This makes it convenient.

If you are creating the application from scratch, in order to use ADO.NET, you must remember to reference the System.Data.dll library and add the System.Data namespace in your file(s).


Home Copyright © 2007 FunctionX, Inc. Next