Results 1 to 5 of 5

Thread: SQL Server connection problem {Resolved}

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2002
    Posts
    434

    SQL Server connection problem {Resolved}

    Hello

    I have an ASP.net project that connects to a SQL server DB. The connection string that I use is the same one that I use in the stand alone version of the app. In the stand alone it works flawlessly. In the ASP.net version it pukes and dies. The error message that comes back is:
    Login failed for user 'HOMEPLATE\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: Login failed for user 'HOMEPLATE\ASPNET'.

    Source Error:


    Line 6258: DBLoader(GroupString)
    Line 6259:
    Line 6260: DC.Open()
    Line 6261: Dim myCommand As New SqlClient.SqlCommand("SELECT LineNumber FROM LineNumber", DC)
    Line 6262: drFormloader = myCommand.ExecuteReader()


    Source File: c:\inetpub\wwwroot\WebApplication1\Filters.aspx.vb Line: 6260

    Stack Trace:


    [SqlException: Login failed for user 'HOMEPLATE\ASPNET'.]
    System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction)
    System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction)
    System.Data.SqlClient.SqlConnection.Open()
    QXEZBidderASP.WebForm1.frmFilters_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\WebApplication1\Filters.aspx.vb:6260
    System.EventHandler.Invoke(Object sender, EventArgs e) +0
    System.Web.UI.Control.OnLoad(EventArgs e)
    System.Web.UI.Control.LoadRecursive()
    System.Web.UI.Page.ProcessRequestMain()
    Here is the connection string that I use:
    Code:
    DC = New SqlClient.SqlConnection("Data Source=homeplate; Initial Catalog=" & DBName & ";Integrated Security=SSPI;")
    Is there some thing different that I need to do with ASP.net?

    Thanks

    David
    Last edited by David RH; Apr 27th, 2006 at 09:43 PM.

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: SQL Server connection problem

    First line of the error: "Login failed for user 'HOMEPLATE\ASPNET'. "
    Simply put, the ASPNET user does NOT have permissions to login to the SQL Server. You'll need to do one of two things.... 1) Grant access to the HOMEPLATE\ASPNET user or 2) change to SQL Login and user to login to the server (by passing integrated security).

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    May 2002
    Posts
    434

    Re: SQL Server connection problem

    Ok I granted access to homeplate\aspnet on the SQL server and that didn't help.

    I'll try the other. What change do I need to make to the connection string?
    Last edited by David RH; Apr 26th, 2006 at 02:05 PM.

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: SQL Server connection problem

    http://www.connectionstrings.com/
    Look here, browse down through their viewer and it'll give you the shell connection stirng you need.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    May 2002
    Posts
    434

    Re: SQL Server connection problem

    Thanks TG that did it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width