System.Data.SqlClient.SqlException: Login failed for user 'xxx\ASPNET'
-
hello, i get this error-> System.Data.SqlClient.SqlException: Login failed for user 'xxx\ASPNET' do some one knows how to solve it? i am new to sql and i use msde. thank u in advance
Can you post the complete error? However I believe must be your Connection String:
SqlConnection myConnection = new SqlConnection("server=127.0.0.1;user id=sa;password=yourpassword;database=yourdatabase""); SqlCommand myCommand = new SqlCommand(sQuery, myConnection); myConnection.Open(); myCommand.ExecuteNonQuery();
Make sure you have a username/password set up on the SQL serve that has access to that database. Albert -
hello, i get this error-> System.Data.SqlClient.SqlException: Login failed for user 'xxx\ASPNET' do some one knows how to solve it? i am new to sql and i use msde. thank u in advance
Sounds like you are using Windows Authentication to connect to the database server. If this what you intend, then make sure either: 1) you set up the ASPNET user on your machine to have access to the database or 2) you run your asp.net under a user that has access to the database. I would recommend 1) if possible. If you intent to use sql authentication, then Albert's suggestion is the way to go. Though you should try to get away from using the sa login in applications...it's just not a good idea to have GOD access for the code your users are running. Hope this helps. Bill. ps: send along the connection string...that'll help.