DrAske
asked on
Error!!
Hi Experts ..
Login failed for user 'CO-B080FE8CE82C\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.SqlE xception: Login failed for user 'CO-B080FE8CE82C\ASPNET'.
Source Error:
Line 36: if(!IsPostBack)
Line 37: {
Line 38: sqlDataAdapter1.Fill(dsPiz zaStores1) ;
Line 39: sqlDataAdapter2.Fill(dsPiz zaStores1) ;
Line 40:
I don't know why this error occured??
this is my connection string :
this.sqlConnection1.Connec tionString = "workstation id=\"CO-B080FE8CE82C\";pac ket size=4096;integrated security=SSPI;data source=\"CO-B080FE8CE82C\" ;persist security info=False;initial catalog=PizzaStore";
..??
Login failed for user 'CO-B080FE8CE82C\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.SqlE
Source Error:
Line 36: if(!IsPostBack)
Line 37: {
Line 38: sqlDataAdapter1.Fill(dsPiz
Line 39: sqlDataAdapter2.Fill(dsPiz
Line 40:
I don't know why this error occured??
this is my connection string :
this.sqlConnection1.Connec
..??
ASKER
Actually ... I'm not familiar in web.config ?? I'm studing ADO.NET and I am developing a sample project (Asp.net web application project instead of using windows-Forms) ..
so how to set SQL User Authentication ??
so how to set SQL User Authentication ??
To use SQL User Authentication, your sql server must be setup to support it. If it is, simply change your connection string to something like:
"server=CO-B080FE8CE82C;us er id=sqluser;password=mypass word;initi al catalog=PizzaStore;"
Where sqluser and mypassword are the user credentials for your sql user.
Jason
"server=CO-B080FE8CE82C;us
Where sqluser and mypassword are the user credentials for your sql user.
Jason
ASKER
I added a new user using Enterprize Manager .. User = pizza ; password= pwpizza
but it gives another error :
Login failed for user 'pizza'. Reason: Not associated with a trusted SQL Server connection.
this.sqlConnection1.Connec tionString = "data source=CO-B080FE8CE82C;ini tial catalog=PizzaStore;user id=pizza; Password=pwpizza";
sorry for this stupid question :(
but it gives another error :
Login failed for user 'pizza'. Reason: Not associated with a trusted SQL Server connection.
this.sqlConnection1.Connec
sorry for this stupid question :(
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Well *whatsit2002* .. it worked ..
Thanx alot ..
and sorry for wasting your time ..
regards, Ahmad;
Thanx alot ..
and sorry for wasting your time ..
regards, Ahmad;
<identity impersonate="true" userName="CO-B080FE8CE82C\
Also, giving the ASPNET user access to resources (such as a database) can be a security risk, so I would recommend impersonating another user.
A second option would be to use SQL User Authentication instead of an SSPI context.
Thanks.
Jason