Getting the ASP database to work

Last post 05-07-2008 10:54 PM by Thomas Sun – MSFT. 4 replies.

Sort Posts:

  • Getting the ASP database to work

    05-01-2008, 4:57 PM
    • Loading...
    • hessw
    • Joined on 12-28-2006, 1:53 PM
    • Junction City, KS
    • Posts 19

    I'm using Visual Studio 2005 and I've loaded the complete Professional version on my computer. I am trying to get a database set up so I can use Forms Authentication to access a web site. I have a ASPNETdb in my application that I can't access, I also have a table on our company's main SQL server that I want to use for all the user information and passwords for authenication when they log in.

     When I try and use any database it says SQL Server 2005 Express edition is not loaded on my machine but I can pull it up with my Managment studio and see it. How do I get my application to point to the database I want to use for authenication. It is in the same database as the other files I'm using for my web pages.

     Don't know if it matters or not but I'm running SQL Server Developer Edition on my computer that I'm working with.

    Thanks in Advance.

  • Re: Getting the ASP database to work

    05-05-2008, 1:58 AM
    Answer

    Hi,

    The Membership provider is very flexible, you can change the data source which is used to stored the user information.

    You can create Membership tables in another database than the standard aspnetdb.mdf. To do so, you need to create the database on SQL Server Developer Edition and then change the connection string for Membership in web.config file.

    For more information, see Create Membership tables in another database than the standard aspnetdb.mdf.


    I hope this helps.

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
  • Re: Getting the ASP database to work

    05-05-2008, 8:01 AM
    • Loading...
    • hessw
    • Joined on 12-28-2006, 1:53 PM
    • Junction City, KS
    • Posts 19

    Great, Thanks for the help

  • Re: Getting the ASP database to work

    05-07-2008, 10:49 AM
    • Loading...
    • hessw
    • Joined on 12-28-2006, 1:53 PM
    • Junction City, KS
    • Posts 19

    OK,

     I''ve followed the advice and set up my connections string like was mentioned in the link that you gave me. I"ve went into my Develope Edition of SQL Server and built another database where I had all the user information, I also built anaspnetdb.mdf database on my local machine and put the path in the connection string.

     Still get the same issue when I try to click on the aspnetdb.mdf under the solution explorer I still get the message that my SQLExpress is not configured or loaded yet I can see it. when I go to my server explorer I can pull the database up and see all the tables.

     When I try and go to the ASP Net Configuration to set up the security it either can't find the database or says something is wrong in my connection string. Here is what I currently have in my web.config as part of my connection string.

    Any help is greatly appreciated.

    Thanks

    <add name="Elementary Login" connectionString="Data Source=dcwaynehess;Initial Catalog=&quot;Elementary Assessments&quot;;Integrated Security=True"

    providerName="System.Data.SqlClient" />

    <remove name ="LocalSqlServer"/>

    <add name="LocalSqlServer" connectionString="DataSource=Zeus;Initial Catalog =&quot;Elementary Assessments&quot;;Integrated Security=True"

    providerName="System.Data.SqlClient" />

    <add name="Zeus" connectionString="DataSource=DCWAYNEHESS\SQLEXPRESS; AttachDbFilename= C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\aspnetdb.mdf&quot;; IntegratedSecurity=True" />

    </connectionStrings>

    <system.web>

    <authentication mode="Forms">

    <forms loginUrl="login.aspx" name="adAuthCookie" timeout="30" path="/">

    </forms>

    </authentication>

    <authorization>

    <deny users="?"/>

    <allow users="*"/>

    </authorization>

  • Re: Getting the ASP database to work

    05-07-2008, 10:54 PM

    Hi,

    hessw:

     When I try and go to the ASP Net Configuration to set up the security it either can't find the database or says something is wrong in my connection string. Here is what I currently have in my web.config as part of my connection string.

    <remove name ="LocalSqlServer"/>

    <add name="LocalSqlServer" connectionString="DataSource=Zeus;Initial Catalog =&quot;Elementary Assessments&quot;;Integrated Security=True"

    providerName="System.Data.SqlClient" />

    <add name="Zeus" connectionString="DataSource=DCWAYNEHESS\SQLEXPRESS; AttachDbFilename= C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\aspnetdb.mdf&quot;; IntegratedSecurity=True" />

    </connectionStrings>

    Thanks for your response.

    Since you have removed the default LocalSqlServer and use the SQL database as LocalSqlServer,  you need to make sure that the new connection string is correct. Please check  

    <add name="LocalSqlServer" connectionString="DataSource=Zeus;Initial Catalog =&quot;Elementary Assessments&quot;;Integrated Security=True" providerName="System.Data.SqlClient" />

    You can get help on connection string from http://www.connectionstrings.com/?carrier=sqlserver2005

     

    I hope this helps. 

     

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Page 1 of 1 (5 items)