MyDatabase.mdf and ASPNETDB.MDF on same site

Discussion in 'Databases' started by gaborez, Sep 12, 2007.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hi

    I'm a bit new to this so excuse if this is a stoopid question...

    I created an asp.net2 webpage that accesses some tables in my db (MyDatabase.mdf), and uploaded it to my discountASP.net account. I attached the MyDatabase.mdf file ok and ran my webpage - it all worked fine :)

    Now, my next step was to learn about logins and security so i setup a simple login page on my pc (which created a ASPNETDB.MDF file) and tested it locally ok. My authentication is working :)

    So i've uploaded it all to my discountASP.net account and think i now have a problem. I only have one SQL database account so i dont think i can now attach the APNETDB.MDF file as well???? or can i?

    If not, how do i add authentication to my site? Obviously i dont want to pay for another SQL server db just to handle logins!

    Thanks v much for any help you can give me

    Jono
     
  2. Joseph Jun

    Joseph Jun DiscountASP.NET Staff

  3. Thanks for that - i'd found it before but was confused! [​IMG]

    My setup uses SQLEXPRESS (i think) that comes with the Visual Web Developer 2005 Express Edition. Will what's described in the KB still work with that? I'm not sure what to put in the command prompt.

    Could you please give me some more info as to what to do, and what the KB is describing?

    THANKYOU VERY MUCH FOR YOUR HELP :)

    jono
     
  4. brilliant! thanks v much for yourhelp - i got there in the end!


    thanks again [​IMG]
     
  5. Jono,

    I'malso using SQLEXPRESS and Visual Web Developer 2005.This workedfor me. . .

    Go to Database Management, choose MS SQL 2005 and then the MS SQL 2005 Databases tab. The MS SQL 2005 Server Information window lists all the information you need. Just substitute your own informationinto the following command:

    aspnet_regsql.exe -S DBServerName -U DBLogin -P DBPassword -A all -d DBName

    Use your SQL Server Name for DBServerName
    Use your Database Login for DBLogin
    Use your Password for DBPassword (your pwis not listed)
    Use your Database Name for DBName

    So the command prompt window will look like this except it will have your own DB information:

    c:\Windows\Microsoft.NET\Framework\v2.0.50727>aspnet_regsql.exe -S DBServerName -U DBLogin -P DBPassword -A all -d DBName

    I'm new at this too but it worked fine.

    Greg
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page