I create an asp.net project. through the server explorer I drag the author table from pubs database.
My server name is called ANAT2005.
through the sqldataadapter I generate dataset.
I put in my page a button and a datagrid, put 2 lines in code in button_click:
sqldataadapter.fill(dataSet11);
datagrid1.databind();
I enter the appropriate datasource and datamember in the properties of datagrid and when I view in browser I get the following error:
I installed the dotnet and sqlserver in this computer only few days ago.
In an older computer I don't have the problem.
Server Error in '/WebApp6' Application.
--------------------------------------------------------------------------------
Login failed for user 'ANAT2005\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 'ANAT2005\ASPNET'.
Source Error:
Line 150: private void Button1_Click(object sender, System.EventArgs e)
Line 151: {
Line 152: sqlDataAdapter1.Fill(dataSet11);
Line 153: DataGrid1.DataBind();
Line 154: }
Source File: c:\inetpub\wwwroot\webapp6\webform1.aspx.cs Line: 152