Understanding the System.Data Namespace

When accessing data, there are two distinct ways to retrieve information. The two entry points for data access are as follows:

  • SqlClient

  • OleDb

By using one or both of these classes, you can read and write data to almost any database. Figure 16.1 give you a bird’s-eye view of how things in the overall .NET data component are organized.

Figure 16.1. Relationships among .NET data components.


The key here is to identify which class will best suit your needs. We will make it very simple for you: If you are using Microsoft SQL Server, you most likely will want to use the SqlClient class for all your work. If you need to connect to any other third-party SQL databases or OLE DB–supported databases such as Oracle, you’re stuck using the OleDb class.

Now that we have looked at the big picture, let’s start looking at the details by beginning with catching SQL errors.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset