Wednesday, August 5, 2009

how to create aspnetdb.mdb database

normal way is launching Visual Studio Prompt and execute aspnet_regsql, and follow subsequence wizard window.

Another way is to generate SQL to create tables and view to the DB you want, and change connection string in web.config. In this way, you can separate personnel information for each individual web application.

  1. aspnet_regsql.exe -A all -sqlexportonly C:\runproviders.sql
  2. open C:\runproviders.sql and replace database name with the one you will use.
  3. connect to SQL server with management tool and execute upper script.
  4. change connection string in web.config


<connectionStrings>
<remove name="LocalSqlServer" />
<add name="classifiedsConnection" connectionString="Data Source=ITDEVSQL01;Initial Catalog=ASPNETDB;Integrated Security=True;" providerName="System.Data.SqlClient" />
<add name="LocalSqlServer" connectionString="Data Source=ITDEVSQL01;Initial Catalog=ASPNETDB;Integrated Security=True;" providerName="System.Data.SqlClient" />
</connectionStrings>

No comments:

Post a Comment