anat2403 Posted December 14, 2005 Posted December 14, 2005 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 Quote
Administrators PlausiblyDamp Posted December 14, 2005 Administrators Posted December 14, 2005 You will need to grant the user account ANAT2005\ASPNET permission to access the SQL database. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
anat2403 Posted December 15, 2005 Author Posted December 15, 2005 Where to do GRANT? You will need to grant the user account ANAT2005\ASPNET permission to access the SQL database. Where do I make this GRANT? in sql server? in server explorer in the VS dot net? in file explorer? where and how? The GRANT is not in ORACLE? I look for solution in sql server 2000. Thankyou. Quote
Administrators PlausiblyDamp Posted December 15, 2005 Administrators Posted December 15, 2005 You need to grant the permissions to the SQL Server database either via Enterprise manager or through T-SQL. The two commands are GRANT and sp_grantlogin Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
anat2403 Posted December 15, 2005 Author Posted December 15, 2005 it worked! You need to grant the permissions to the SQL Server database either via Enterprise manager or through T-SQL. The two commands are GRANT and sp_grantlogin ThankYou very much. It finally worked. My server name is ANAT2005 and I undestand that the ASPNET is a name that is added by the dot net? So it wasn't recognized? Thanks again. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.