none
running web site under IIS instead of Microsoft Visual Web Developer 2008 Express Edition RRS feed

  • Question

  • There must be a procedure to do what I am trying to do.

     

    Well it should work!

     

    MS SQL Server Management Studio Express says the name is LANDON\SQLEXPRESS.

     

    Below the error says: LANDON\ASPNET

     

    (1) downloaded and installed Microsoft Visual Web Developer 2008 Express Edition

    (2) converted an old web site I developed under the 2005 version
                  it worked great with the former SQL 2005 Server table I had
    using :
    http://localhost:2188/Update/

     

    (3) I created a virtual directory under IIS       C:\Update
    and copied all the files from the converted web site that worked (above) into C:\Update

    I started the site under IIS as follows:
    using:
    http://localhost/update/default.aspx
    I got an error:

    Server Error in '/Update' Application.

    Cannot open database "logbookid" requested by the login. The login failed.
    Login failed for user 'LANDON\ASPNET'.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.SqlClient.SqlException: Cannot open database "logbookid" requested by the login. The login failed.
    Login failed for user 'LANDON\ASPNET'.

    Source Error:

    Line 64:         try
    Line 65:         {
    Line 66:             cnObj.Open();
    Line 67: 
    Line 68:             // Create a SqlCommand object and assign the connection

    Source File: c:\Update\Default.aspx.cs    Line: 66

    Stack Trace:

    [SqlException (0x80131904): Cannot open database "logbookid" requested by the login. The login failed.
    Login failed for user 'LANDON\ASPNET'.]
       System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +435
       System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82
       System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
       System.Data.SqlClient.SqlConnection.Open() +111
       _Default.PopulateGrid() in c:\Update\Default.aspx.cs:66
       _Default.Page_Load(Object sender, EventArgs e) in c:\Update\Default.aspx.cs:59
       System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
       System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +33
       System.Web.UI.Control.OnLoad(EventArgs e) +99
       System.Web.UI.Control.LoadRecursive() +47
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436
    
    Friday, January 18, 2008 4:09 AM

All replies

  • Looks like your ASPNET account does not have permissions to access database. You need to add ASPNET account to the users that have permissions to access database. See next link with the details about what to do

     

    http://support.microsoft.com/kb/316989/en-us

    Friday, January 18, 2008 11:11 AM
    Moderator
  • Sounds right but how does one do these things?

    I am new in web development!

    MS SQL Server

    I tried to add a login to MS SQL Server 2005 Management Studio Express

    LANDON\ASPNET

    but it was rejected.

    I am looking into the basic XP Prof management login list.



    RESOLUTION

    To resolve this issue, use one of the following methods:
    Method 1 Programmatically change the security context of the ASP.NET worker process to a user who has the correct SQL Server permissions.
    Method 2 Change the default configuration of ASP.NET so that the ASP.NET worker process starts and runs under the context of a user who has the correct permissions in SQL Server.
    Method 3 Grant the correct permissions in SQL Server so that the ASPNET account (or NetworkService account, for an application that runs on IIS 6.0) has the appropriate access to the required resources.

    Note This method will make all the Web applications on the server have the corresponding right on the computer that is running SQL Server.
    Friday, January 18, 2008 7:18 PM
  • Iandon1,

     

    All you need to do is go to the command prompt, type in the following command and it should work.

     

    aspnet_regiis -i

     

    This should work.

     

    regards,

    Amit J R

     

    Saturday, January 19, 2008 10:51 AM
  • Setting environment for using Microsoft Visual Studio 2008 x86 tools.

    C:\Program Files\Microsoft Visual Studio 9.0\VC>aspnet_regiis -i
    Start installing ASP.NET (2.0.50727).
    ..............................................
    Finished installing ASP.NET (2.0.50727).

    C:\Program Files\Microsoft Visual Studio 9.0\VC>



    got the same error: I'll try rebooting!

    Server Error in '/Update' Application.

    Cannot open database "logbookid" requested by the login. The login failed.
    Login failed for user 'LANDON\ASPNET'.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.SqlClient.SqlException: Cannot open database "logbookid" requested by the login. The login failed.
    Login failed for user 'LANDON\ASPNET'.

    Source Error:

    Line 64:         try
    Line 65: {
    Line 66: cnObj.Open();
    Line 67:
    Line 68: // Create a SqlCommand object and assign the connection

    Source File: c:\Update\Default.aspx.cs    Line: 66

    Stack Trace:

    [SqlException (0x80131904): Cannot open database "logbookid" requested by the login. The login failed.
    Login failed for user 'LANDON\ASPNET'.]
    System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +435
    System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82
    System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
    System.Data.SqlClient.SqlConnection.Open() +111
    _Default.PopulateGrid() in c:\Update\Default.aspx.cs:66
    _Default.Page_Load(Object sender, EventArgs e) in c:\Update\Default.aspx.cs:59
    System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
    System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +33
    System.Web.UI.Control.OnLoad(EventArgs e) +99
    System.Web.UI.Control.LoadRecursive() +47
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436

    Saturday, January 19, 2008 4:26 PM
  • rebooting did not help...same error!
    Developers routinely develop web sites using Visual Studio

    that ultimately end up running under IIS.

    This must be a simple task!
    Saturday, January 19, 2008 4:40 PM
  • I got an email telling me to reply as to whether this question has been answered!


                This question has NOT been answered!
    Monday, January 21, 2008 5:01 PM
  • Ian,

     

    From what i could make out you are trying to connect to a SQL database. PLease ensure this that you have added your ID LANDON to the Network Service group and then to the LogBookID database give permissions to the network service group. This is for win 2003 OS.

    Wednesday, January 23, 2008 12:13 PM
  • Network Service group...where?



    Wednesday, January 23, 2008 8:01 PM