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:
Quote:
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
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
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?
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
Re: SQL Server connection problem