Skip to Content
Beginning ASP.NET 3.5: In C# and VB
book

Beginning ASP.NET 3.5: In C# and VB

by Imar Spaanjaars
March 2008
Intermediate to advanced content levelIntermediate to advanced
766 pages
21h 15m
English
Wrox
Content preview from Beginning ASP.NET 3.5: In C# and VB

B.2. Configuring Application Services

Earlier in this book you learned that the ASP.NET application services make use of a SQL Server 2005 database that is reached by using a connection string called LocalSqlServer. The application services then ensure that a new database called aspnetdb.mdf is created in your web site's App_Data folder the very first time you use one of the application services like Membership or Profile.

What if you don't want to use the default aspnetdb.mdf database but rather one of your own? Or what if you rather not rely on a local SQL Server Express database to be created for you, and instead want to get your membership, role, and profile data from your own, dedicated server?

In such cases, you need to reconfigure your application (through the web.config file) and tell it where your database is located. There are two ways to accomplish this: overriding the LocalSqlServer connection string, and overriding the settings for the various application services. However, before you look at these two options, you need to know how you can prepare a custom database for the ASP.NET application servicess.

B.2.1. Configuring Your Database for the Application Services

When the aspnetdb database is created for you in the App_Data folder, it already contains a number of objects like tables and stored procedures (snippets of SQL code that can be executed at the server). If you want to use your own database instead of the default one, you need to prepare your database for ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning ASP.NET 4: in C# and VB

Beginning ASP.NET 4: in C# and VB

Imar Spaanjaars
Professional ASP.NET 3.5 SP1 Edition: In C# and VB

Professional ASP.NET 3.5 SP1 Edition: In C# and VB

Bill Evjen, Scott Hanselman, Devin Rader

Publisher Resources

ISBN: 9780470187593Purchase book