public int Validate_login(string Username, string Password) { SqlConnection con = new SqlConnection(ConfigurationSettings.AppSettings["connect"]); SqlCommand cmdselect = new SqlCommand(); cmdselect.CommandType = CommandType.StoredProcedure; cmdselect.CommandText = "Login_detail1"; cmdselect.Parameters.Add("@Username", Username); cmdselect.Parameters.Add("@Password", Password); cmdselect.Parameters.Add("@OutRes", SqlDbType.Int, 4); cmdselect.Parameters["@OutRes"].Direction = ParameterDirection.Output; cmdselect.Connection = con; int Results = 0; try { con.Open(); cmdselect.ExecuteNonQuery(); Results = (int)cmdselect.Parameters["@OutRes"].Value; } catch (SqlException ex) { lblresult.Text = ex.Message; } finally { cmdselect.Dispose(); if (con != null) { con.Close(); } } return Results; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)