i want to display data on a web page
i m using sql server 2000 and northwind database
but when i run my project then error comes on web page and data doesn't displayed.
This error comes on web page
Server Error in '/WebApplication2' Application.
Login failed for user 'PC1\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 'PC1\ASPNET'.
Source Error:
Line 95:
Line 96: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Line 97: SqlDataAdapter1.Fill(DataSet11)
Line 98: DataGrid1.DataBind()
Line 99:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
SqlDataAdapter1.Fill(DataSet11)
DataGrid1.DataBind()
End Sub
plz see the attache file
can any body tell me what is the problem.
in the Server explorer right-click the database you work with and select "close connection" then run the app again. At least it is the way i am fixing this odd error. If anyone knows a better way it would be nice to share the solution with us.
You're attempting to connect to your SQL Server with Integrated Security. That means it will connect as the user under which the web application is running. By default, this is ASPNET, and by default, the ASPNET worker process has very little permission to do anything. You need to modify your connection string to use a proper SQL Server user. If you don't have one yet, then login to your SQL Server Management IDE and create a user, give the user permissions on the database you want to connect to and then specify that username and password in your connectionstring.