Workaround for user hp-2v47vi88m4gb\aspnet logon failure

Source: Internet
Author: User
Tags stack trace
Solve the first time in order to complete the symbolic operation of the use of ASP.net, asp.net ah, Khan. So immediately ran into a problem, I now write the question, for the development of ASP.net people, this question should not become a problem, I also just contact with asp.net people. The following error occurred while trying the DataGrid last night:

A server error in the "/datagridtest" application.
--------------------------------------------------------------------------------
User ' Hp-2v47vi88m4gb\aspnet ' login failed.
Note: An unhandled exception occurred during the execution of the current WEB request. Check the stack trace for more information about the error and where the error occurred in the code.
Exception Details: System.Data.SqlClient.SqlException: User ' hp-2v47vi88m4gb\aspnet ' login failed.
SOURCE Error:

Row 31:if (!this. IsPostBack)
Line 32: {
Line 33:sqldataadapter1.fill (dataset11,0,10, "products");
Line 34:this. DataBind ();
Line 35:}

Source file: C:\inetpub\wwwroot\datagridtest\webform1.aspx.cs Line: 33
Stack trace:

[SqlException: User ' hp-2v47vi88m4gb\aspnet ' login failed. ]
System.Data.SqlClient.ConnectionPool.GetConnection (boolean& isintransaction) +474
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection (sqlconnectionstring options, boolean& IsInTransaction) +372
System.Data.SqlClient.SqlConnection.Open () +384
System.Data.Common.DbDataAdapter.QuietOpen (idbconnection connection, connectionstate& originalstate) +44
System.Data.Common.DbDataAdapter.FillFromCommand (Object Data, Int32 Startrecord, Int32 maxrecords, String srctable, IDbCommand command, CommandBehavior behavior) +304
System.Data.Common.DbDataAdapter.Fill (DataSet DataSet, Int32 Startrecord, Int32 maxrecords, String srctable, IDbCommand command, CommandBehavior behavior) +77
System.Data.Common.DbDataAdapter.Fill (DataSet DataSet, Int32 Startrecord, Int32 maxrecords, String srctable) +40
DataGridTest.WebForm1.Page_Load (Object sender, EventArgs e) in c:\inetpub\wwwroot\datagridtest\webform1.aspx.cs:33
System.Web.UI.Control.OnLoad (EventArgs e) +67
System.Web.UI.Control.LoadRecursive () +35
System.Web.UI.Page.ProcessRequestMain () +750

==============================================================================
According to my present exception, my solution is as follows:
1, create "Computer name \aspnet" user in SQL Server. Like I created Hp-2v47vi88m4gb\aspnet.
2. Open the Security folder in SQL Enterprise Manager, right-click "Login" and select "New Login ...". General tab, name fill hp-2v47vi88m4gb\aspnet, other default, Database Access tab, specify the database to access, I specify the Northwind database, and then give him permission: Dbo,public is enough.
If there is a better way, please advise

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.