Link to home
Start Free TrialLog in
Avatar of jklinger1975
jklinger1975

asked on

Connecting asp.net web app to SQL database

Hi Experts,

I am configuring my first membership site in Visual Studio 2005 (c#).

I have separately created a database in MS SQL 2005 and then ran the config wizard (aspnet_regsql.exe)  to set up all of the tables and processes etc.

I then successfully connected my new site to this database and the web.config file looks good.

However, when I launch the asp.net configuration wizard from within Visual Studio to create users, roles, etc. it still wants to create the aspnetdb.mdb file.

Am I missing something here? How do I make the asp.net config wizard see the real SQL database (I am not interested in using Express since I have the full edition)?

I have examined many articles and tried the advanced link. But I am oviously missing something.

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of MikeMCSD
MikeMCSD
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
try
aspnet_regsql.exe -S <server> -U <login id> -P <password> -d <database> -A all ..

after you do this, can you confirm whether you have this in web.config

<membership defaultProvider="CustomizedMembershipProvider">
      <providers>
         <add name="CustomizedMembershipProvider"
              type="System.Web.Security.SqlMembershipProvider"
              connectionStringName="ConnectionStringNameToYourDatabase" /> -- the datbase and server you used in aspnet_regsql ...
      </providers>
    </membership>
Avatar of jklinger1975
jklinger1975

ASKER

Thanks! That explained it to me.