Peter Ishere

Peter Ishere

  • NA
  • 40
  • 0

Login failed for user 'MyDomain\TestUser'. [CLIENT: ]

Apr 13 2009 6:20 AM
Hi Everybody I am getting the above error in my Event viewer when I want to connect to my SQL. Below is my code. public string validate_login(string username, string password) { /*Reading from the App.config file in the project. */ string connstring = ConfigurationSettings.AppSettings["SQLConn"].ToString(); sql.SqlConnection conn = new System.Data.SqlClient.SqlConnection(connstring); string proc = "Validate_Login"; sql.SqlCommand comm = new System.Data.SqlClient.SqlCommand(proc, conn); comm.CommandType = System.Data.CommandType.StoredProcedure; comm.Parameters.Add("@Username", System.Data.SqlDbType.NVarChar).Value = username; comm.Parameters.Add("@Password", System.Data.SqlDbType.NVarChar).Value = password; conn.Open(); sql.SqlDataReader dr; dr = comm.ExecuteReader(); if (dr!=null) { // Console.WriteLine("Values returned"); return "Excist"; } else { // Console.WriteLine("No values returned"); return "Non-Excist"; } } On my Conn.Open() i get the following error: "A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.)"

Answers (1)