User Login Troubles

Hi,

I pretty new to all of this. I have followed the tutorial on http://beta.asp.net/guidedtour2/ and is working all ok locally. When I uploaded to IIS 6 on a Windows Server 2003 SP1 and tried logging in using login.aspx it gave me this error:

An attempt to attach an auto-named database for file C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\WebSites\WebSite1\App_Data\aspnetdb.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

What solution(s) can I try to get the loggin script working

If anymore info is required like the Stack Trace I will do my best to get it.

Thanks.

Lewis Cobley


Answer this question

User Login Troubles

  • E-Shy

    I am using Visual Web Developer 2005 Express Edition with SQL Server 2000 to create a web app using the login controls and roles. I used the aspnet_regsql.exe to create the required tables and stored procedures onto an exsisting SQL Server 2000 database on a server. I have also directed the membership and role providers to point to the database. Now, when I run the web app locally, the login and roles I have created on the web admin tools works fine, but when I upload to web app to the IIS on the server, none of the login and roles seem to work. How can I fix this problem

  • Pioter

    Hi Lewis,

    If you are using MS SQL Server (instead of SQL Server Express), then you should run the aspnet_regsql.exe command-line tool to create the proper tables needed for membership, etc... on that SQL Server.

    Once you do that, you also need to edit the web.config file to change the provider connection to point to that SQL Server.

    The tricky part in doing this is that there is no simple tool in Beta2 to transfer data from SQL Server Express (MDF file) -- into MS SQL Server 2005.  Thus you will need to recreate the data in the other database.

    We will be providing an import/export tool to pull data from SQL Express in the final release.

  • mehdi62b

    This is most likely a problem with your connection string, why don't you try to use the aspnetdb in sqlserver instead
  • Daggs

  • Jacob Christ

    Well I get this error:

    The process cannot access the file 'C:\DOCUMENTS AND SETTINGS\IBRAHIM\MY DOCUMENTS\VISUAL STUDIO 2005\WEBSITES\CLUB WEB SITE STARTER KIT3\APP_DATA\ASPNETDB.MDF.MDF'

    I am running sql-2005 on the local machine

    The aspnetdb database is present

    The config settng is:

    <add name="LocalSqlServer" connectionString="data source=-nottellingyou-;Integrated Security=sspi; AttachDBFilename=|DataDirectory|aspnetdb.mdf;" providerName="System.Data.SqlClient"/>

    While the clubsite.mdf does show in the app_data folder, the aspnetdb.mdf does not.

    The site will come up, but of course an attempt to log on brings on the above error.

    I am using the cassini server on this Win-xp mediacenter sp2 install.



  • Brandon Bray

    HOW DO I DO THAT "CHANGE THE PROVIDER CONENCTION"


     Omar Khan wrote:
    Hi Lewis,

    If you are using MS SQL Server (instead of SQL Server Express), then you should run the aspnet_regsql.exe command-line tool to create the proper tables needed for membership, etc... on that SQL Server.

    Once you do that, you also need to edit the web.config file to change the provider connection to point to that SQL Server.

    The tricky part in doing this is that there is no simple tool in Beta2 to transfer data from SQL Server Express (MDF file) -- into MS SQL Server 2005.  Thus you will need to recreate the data in the other database.

    We will be providing an import/export tool to pull data from SQL Express in the final release.


  • futureadmin

    Hi,

    I am running MS SQL Server 2005 CTP April. That is running on the server but the only table I created was the one using an ASP.NET 2.0 tutorial. Although now when I try to login it says incorrect password.

    Thanks for your help.

    Lewis

  • Tom Kaminski

    Hi Lewis,

    Do you have SQL Server Express installed on the target machine   By default the login system uses SQL Server Express to store user information so if its not installed I would expect an error similar to what you are seeing.



  • kurjan

    I am also having login issues with the Club Web site.  The site will run OK from the Developer environment but when I attempt to login from a regular browser I get a Failed to update database "C:\INETPUB\WWWROOT\COMMUNITY\APP_DATA\ASPNETDB.MDF" because the database is read-only error.  I have given aspnet full rights to the APP_DATA directory but that does not help.

    Does any one know of information on how to set this up in a real environment

    Thanks

  • Andy Ho

  • Sameer Bhangar - MSFT

    I am trying to set this up starting with MS SQL Server instead of SQL Server Express.  I ran the aspnet_regsql.exe command-line tool and it set up all the proper tables needed.  What has to be added to the web.config file    My web.config file is exactly like the one in the Guided tour, I only have one connectionstring to Pubs.  Where can I get more info on this
  • User Login Troubles