asp.net.ph

Skip Navigation LinksHome > Data Access / ADO.NET > ADO.NET Primer > Setting up ASP.NET Pages for Data Access

ADO.NET Primer

Accessing Data with ADO.NET


Setting up ASP.NET Pages for Data Access

The SQL Server™ .NET Data Provider classes are accessed via the System.Data.SqlClient namespace. To use these classes, you need to include the namespace in your applications.

To do so, use the @ Import directive at the top of the page, as in the following.

<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>

The OLE DB .NET Data Provider classes are accessed via the System.Data.OleDb namespace. Likewise, to use these classes, you need to include the namespace in your applications.

<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>

The System.Data namespace consists mostly of the classes that constitute the ADO.NET architecture that are common to both providers. Together, these directives cover the needed set of interfaces for creating distributed, data-sharing .NET applications.

NOTE: Use of the SQL Server™ .NET Data Provider or OLE DB .NET Data Provider requires the installation of Microsoft Data Access Components ( MDAC ) 2.8 or later on the Web server.

More ...
Back to top


© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note