(Repost) Problem with Login Control in IIS

Last post 05-22-2008 2:24 PM by vivekmang. 4 replies.

Sort Posts:

  • (Repost) Problem with Login Control in IIS

    05-21-2008, 1:36 PM
    • Member
      point Member
    • vivekmang
    • Member since 05-19-2008, 5:01 PM
    • Posts 9

    Hi Guys,

    I created a web application on my Windows XP laptop running SQLSERVER express 2005 and visual studio 2008.

    In my web application I am using the LOGIN control that is provided by ASP.NET.

    The Login control uses the ASPNETDB.MDF database to keep track of membership information etc. 

    The thing is Login control works great when I am launching the application from inside of Visual Studio 2008.

    But the Login control doesn;t work when accessed from IIS (on my laptop). After entering the username/password and clicking Submit , I get this:

    Unable to open the physical file "D:\VS2008_Workspace\ShoppingCart\App_Data\aspnetdb_log.ldf". Operating system error 5: "5(Access is denied.)".
    An attempt to attach an auto-named database for file D:\VS2008_Workspace\ShoppingCart\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.

    I can't understand why it shoudn't work from IIS, when it works from inside of the Visual Studio IDE

    Here is the configuration information for the ASPNETDB database: ( from web.config file)

    <add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;Integrated Security=True;User Instance=true"

    providerName="System.Data.SqlClient" />

     

    Why isn't the Login control working from IIS ?

  • Re: (Repost) Problem with Login Control in IIS

    05-21-2008, 1:38 PM
    • All-Star
      50,581 point All-Star
    • Curt_C
    • Member since 07-23-2003, 8:27 PM
    • Plover, WI - USA
    • Posts 5,438
    • Moderator
      TrustedFriends-MVPs

    IIRC, you can add in the InitialCatalog to the string to correct this.

    Blatant Self-Promotion: Book Released - ASP.Net CMS Development
  • Re: (Repost) Problem with Login Control in IIS

    05-21-2008, 3:16 PM
    • Member
      point Member
    • vivekmang
    • Member since 05-19-2008, 5:01 PM
    • Posts 9

    Thanks for your response.

    I did try after adding the Initial Catalog in the connectiion string so that it now looks like this:

    data source=.\SQLEXPRESS;Initial Catalog=ASPNETDB;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;Integrated Security=True;User Instance=true

     

    But I am still getting an error when I hit the Submit button on the LOGIN control (Its now a different error)

    Unable to open the physical file "D:\VS2008_Workspace\ShoppingCart\App_Data\aspnetdb_log.ldf". Operating system error 5: "5(Access is denied.)".
    Cannot create file 'D:\VS2008_Workspace\ShoppingCart\App_Data\aspnetdb_log.LDF' because it already exists. Change the file path or the file name, and retry the operation.
    Could not open new database 'ASPNETDB'. CREATE DATABASE is aborted.
    Cannot attach the file 'D:\VS2008_Workspace\ShoppingCart\App_Data\aspnetdb.mdf' as database 'ASPNETDB'.

    Now its is complaining about the access to ASPNETDB_LOG.MDF file 

    I am also accessing another Sql Server file in my web application and its connection string looks like this:

    Data Source=.\SQLEXPRESS;Initial Catalog=Halloween;Integrated Security=SSPI;AttachDbFileName=|DataDirectory|\Halloween.mdf;Integrated Security=True;User Instance=True

    Its funny because it is able to access this (Halloween) SQL Server Database without any problems

    The ASPNETDB is the one its having problems with ..

    Do you have any ideas ?

     

     


     

  • Re: (Repost) Problem with Login Control in IIS

    05-22-2008, 8:15 AM
    Answer
    • All-Star
      50,581 point All-Star
    • Curt_C
    • Member since 07-23-2003, 8:27 PM
    • Plover, WI - USA
    • Posts 5,438
    • Moderator
      TrustedFriends-MVPs

    Now you are getting the error on the LDF, if you just put this up you can go ahead and remove this (just rename it) and try... I've had that work for me.

    Blatant Self-Promotion: Book Released - ASP.Net CMS Development
  • Re: (Repost) Problem with Login Control in IIS

    05-22-2008, 2:24 PM
    • Member
      point Member
    • vivekmang
    • Member since 05-19-2008, 5:01 PM
    • Posts 9

    Finally ..... it worked!!! 

    I renamed the LDF file and tried it from IIS and the login control worked. Great Big Smile

    Thanks Bud.

Page 1 of 1 (5 items)