Configuring ASP.NET 2.0 apps to SQL Server 2005 databases

Without data access, ASP.NET applications are just pretty Web pages. Trouble is, connecting ASP.NET apps to a SQL Server database isn't exactly a walk in the park, particularly when working with the beefed-up security features in ASP.NET 2.0 and SQL Server 2005.

The topic of configuring ASP.NET 2.0 applications to work with SQL Server 2005 first came up, naturally, in the weeks before both products were released to the world. Since different enterprises migrate to new technologies at different speeds, though, we thought it wise to revisit this topic by pointing to a couple very thorough tutorials.

The first tutorial, Configuring an ASP.NET 2.0 Application to Work with Microsoft SQL Server 2000 or SQL Server 2005 by Imar Spaanjaars, begins with a quick look at the two types of authentication that can be used to access a SQL Server database. From there, the author offers quick hints for attaching the appropriate databases to SQL Server.

The bulk of Spaanjaars's piece, though, centers on the three main scenarios for configuring the database and application:

  • SQL Server authentication -- " From a configuration point of view, this is probably the easiest scenario to configure: all you need to do is create a user in SQL Server, assign a password and then use that account in the connection string."
  • Windows Authentication with IIS and the database on the same machine -- " This scenario makes it easy to use Integrated Security because both the web server and SQL Server can use the same Windows account."
  • Using Windows Authentication with IIS and the database on different machines -- " When using this scenario, there are two options that you need to be aware of: both machines fall under the same Windows domain, or both machines can be seen as independent, stand alone machines."

The second tutorial, Configuring ASP.NET 2.0 Application Services to use SQL Server 2000 or SQL Server 2005, comes from Scott Guthrie. ASP.NET 2.0 comes with several application services, which are APIs governing membership, roles, personalization and other "super common scenarios with Web applications today," Guthrie notes.

Out of the box, these application services are configured to use the free SQL Express database, so Guthrie provides a quick walkthrough of the process of connecting the services to a regular old SQL Server database. Fortunately, there is a wizard to lead developers along.

Once the application is configured to its database, development can begin in earnest. Questions will undoubtedly emerge along the way, and in that regard, one should visit the ASP.NET 2.0 Learning Guide or the SQL Server 2005 Learning Guide for assistance.

This was first published in March 2007

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.