You want to speed up data access in an application that will always be used with SQL Server.
Use the SQL Server managed provider instead of the
OleDB managed provider for accessing the data in
In the code-behind class for the page, open a connection to a SQL
Server database using the
To test the SQL provider, we have implemented our example from
Recipe 16.3 and replaced the
getDataAdapterTime methods in the code-behind with
the code shown in Example 16-10 (VB) and Example 16-11 (C#). The output of the test is shown in Figure 16-3.
Figure 16-3. Performance using SQL managed provider output
The common language runtime (CLR) provides four managed providers for
accessing data in a database: SQL,
and Oracle. The
OleDB and ODBC providers can be
used to access virtually any database—including SQL Server,
Access, Oracle, and many others—using an
OleDB (or ODBC) layer.
communicates to a data source through both the
OleDB service component, which provides connection
pooling and transaction services, and the
provider for the data source. In contrast, the SQL Server provider
uses a proprietary protocol to directly access SQL Server,
eliminating the additional layer of the
OleDB service component and thereby improving ...