La première fois que j'ai utilisé ASP.NET pour terminer les devoirs symboliques, j'ai utilisé ASP.NET pour la première fois, Sweat. J'ai donc rencontré le problème. Lorsque j'ai essayé DataGrid hier soir, les erreurs suivantes sont apparues:
L'erreur du serveur dans l'application "/ dataGridTest".
------------------------------------------------ - - -------------------------------------------------- ------------------------
L'utilisateur «HP-2VI88M4GB / ASPNET» a échoué.
Remarque: Pendant la demande Web actuelle, des anomalies déraisonnables se produisent. Veuillez vérifier les informations de suivi de la pile pour comprendre les informations détaillées sur l'erreur et la source de l'erreur dans le code.
Détails: System.Data.SqlClient.Sqlexception: User 'HP-2V47VI88M4GB / ASPNET' Login a échoué.
Erreur source:
Marche 31: if (! This.ispostback))
Ligne 32: {
Ring 33: SQLDATAADAPTER1.Fill (DataSet11,0,10, "Products");
Ligne 34: this.databind ();
Ligne 35:}
Fichier source: c: /inetpub/wwwroot/datagridtest/webform1.aspx.cs Ligne: 33
Suivi de pile:
[SQLEXception: l'utilisateur «HP-2v47VI88M4GB / ASPNET» a échoué. ]]
System.Data.SqlClient.ConnectionPool.getConnection (Boolean & IsIntraction) +474
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection (SqlConnectionStringoptions, Boolean & IsIntransaction) +372
system.data.sqlclient.sqlconnection.open () +384
System.Data.Common.DbdataAdapter.Qutopen (IdbConnectionConnection, ConnectionState & OriginalState) +44 +44
System.data.comon.dbdataadapter.fillFromCommand (ObjectData, int32StartReco D, int32MaxRecords, StringSrctable, idbCommandCommand, CommandBehavior)))) +304
System.data.Common.dbdataDapter.fill (DataSetDataSet, Int32StartRecord, Int32maxRecords, StringsRctable, IDBCommandCommand, CommandBehavior) +77777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 77
System.Data.Common.DbdatAdapter.Fill (DataSetDataset, int32StartCord, int32MaxRecords, StringsRcable) +40) +40
DataGridTest.WebForm1.Page_Load (ObjectSender, EventArgse) Inc: /Intpub/wwwroot/datagridtest/webform1.aspx.cs: 33: 33
System.web.ui.control.onload (EventArgse) +67 +67
System.Web.Ui.Control.Loadresive () +35
System.Web.Ui.Page.ProcessRequestMain () +750
================================================. ===================
Selon l'exception de mon apparence, ma solution est la suivante:
1. Créez un utilisateur "nom d'ordinateur / ASPNET" dans SQLServer. Par exemple, j'ai créé HP-2V47VI88M4GB / ASPNET
2. Ouvrez le dossier "Security" dans SQLenterPriseManager, droite -click "Login" et sélectionnez "New Login ...". L'onglet "conventionnel", "Nom" remplit HP-2v47VI88M4GB / ASPNET, autre par défaut; Essence
Si vous avez une meilleure façon, veuillez ne pas conseiller