Connecting to Microsoft SQL Server

By default, the SqlDataSource control is configured to connect to Microsoft SQL Server version 7.0 or higher. The default provider used by the SqlDataSource control is the ADO.NET provider for Microsoft SQL Server.

You represent a database connection string with the SqlDataSource control’s ConnectionString property. For example, the page in Listing 9.1 includes a SqlDataSource control that connects to a local SQL Server 2008 database (see Figure 9.1).

Figure 9.1. Displaying the Movies database table.

image

Listing 9.1. ShowLocalConnection.aspx

In Listing 9.1, the SqlDataSource control uses the following connection ...

Get ASP.NET 4 Unleashed now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.