Posted on 7/12/2011

Creating the Membership Database.

Locate and run aspnet_reqsql.exe from a DOS prompt.  It should be located in  c:\Windows\Microsoft.NET\Framework\v4.030319.

The ASP.NET SQL Server Setup Wizard creates the Web site in the instance you specify in the wizard. The key is to modify the Web.config in your project to access the local aspnetdb.mdf.

<configuration>
    <connectionStrings>
      <add name="LocalSqlServer"
         connectionString="data source=(local); Integrated Security=SSPI;Initial Catalog=aspnetdb;"
         providerName="System.Data.SqlClient" />
    </connectionStrings>
</configuration>

 

or , if you are using SQL Server from the Internet you would use a connection string like below.

configuration>
    <connectionStrings>
    <add name="MembershipConnectionString"
         connectionString="Data Source=sql2k510.discountasp.net; InitialCatalog=SQL2005_77; Persist Security Info=True;User ID=SQL2005_77_user; Password=password"
         providerName="System.Data.SqlClient" />
    </connectionStrings>
</configuration>