ASP.NET Provider Model Setup

This section summarizes the database configuration settings required to use the ASP.NET membership and roles provider model with your WCF services. You’ll learn how to override the default settings in the machine configuration file, how to select the right database connection for your environment, and how to initialize tables for the built-in ASP.NET providers including those for membership and roles.

Generating ASP.NET Provider Tables

For ASP.NET providers to work, the database must be initialized with the ASP.NET provider tables.

If you are using SQL Express, a new database is created for you when you use the ASP.NET web site configuration tool. This database file has an .mdf extension and is generated in the web site \App_Data directory.

If you are using SQL Server 2000 or 2005, or if you would like to use the central SQL Express database instead of individual files, you must run the ASP.NET SQL registration utility—aspnet_regsql.exe—by following these instructions:

  1. From the Visual Studio 2008 command line, type aspnet_regsql.exe. The wizard will launch; skip to the second page.

  2. From the “Select a Setup Option” page, select “Configure SQL Server for application services.”

  3. From the “Select the Server and Database” page, enter your server name, usually your machine name. If you are using SQL Express, type your machine name followed by “\SQLEXPRESS” ([machinename]\SQLEXPRESS). If you forget to type SQLEXPRESS, you will be attempting to connect to a SQL Server ...

Get Learning WCF now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.