MRMAN
06-28-2006, 11:49 AM
Hello.
I have made two projects. The first is a windows application and the second is a ASP.NET Web Application.
The windows app is stored in c:\winapps\staffing\
and the web app is stored in c:\Inetpub\wwwroot\staffing
The applications should do the same thing. Bacisally when i user enters a id number in box one or the name in box two the details will be taken from the database and fill in the missing text.
i.e. the user enters 1 and the name of person 1 will be filled in the other box.
This works well in the windows app. So well infact i decided to make the code work in a web app.
But i have gotten a problem. when i try and access the database it says
"Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
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 '(null)'. Reason: Not associated with a trusted SQL Server connection.
Line 60: SqlDataAdapter dataAdapter = new SqlDataAdapter(query, connectionString);
Line 61: DataSet myDataSet = new DataSet();
Line 62: dataAdapter.Fill(myDataSet);
Line 63: DataTable table = myDataSet.Tables[0];
Line 64: int numberRows = table.Rows.Count;
Source File: c:\inetpub\wwwroot\staffing\webform1.aspx.cs Line: 62 "
Does anyone know if this is caused by being on the localhost iis (forgot to say that). The c:\inetpub\wwwroot\staffing\webform1.aspx file can be access http://localhost/staffing/webform1.aspx".
Thank You
I have made two projects. The first is a windows application and the second is a ASP.NET Web Application.
The windows app is stored in c:\winapps\staffing\
and the web app is stored in c:\Inetpub\wwwroot\staffing
The applications should do the same thing. Bacisally when i user enters a id number in box one or the name in box two the details will be taken from the database and fill in the missing text.
i.e. the user enters 1 and the name of person 1 will be filled in the other box.
This works well in the windows app. So well infact i decided to make the code work in a web app.
But i have gotten a problem. when i try and access the database it says
"Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
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 '(null)'. Reason: Not associated with a trusted SQL Server connection.
Line 60: SqlDataAdapter dataAdapter = new SqlDataAdapter(query, connectionString);
Line 61: DataSet myDataSet = new DataSet();
Line 62: dataAdapter.Fill(myDataSet);
Line 63: DataTable table = myDataSet.Tables[0];
Line 64: int numberRows = table.Rows.Count;
Source File: c:\inetpub\wwwroot\staffing\webform1.aspx.cs Line: 62 "
Does anyone know if this is caused by being on the localhost iis (forgot to say that). The c:\inetpub\wwwroot\staffing\webform1.aspx file can be access http://localhost/staffing/webform1.aspx".
Thank You