and when trying to login, it shows password did not match.
protected void Do_Login()
{
SqlCommand com2 = new SqlCommand("select_Salt_Password", con);
com2.CommandType = CommandType.StoredProcedure;
com2.Parameters.Add("@User_Id", SqlDbType.NVarChar, 50).Value = ddl.SelectedItem.Text;
SqlDataAdapter da1 = new SqlDataAdapter(com2);
DataTable dt1 = new DataTable();
da1.Fill(dt1);
string salt = dt1.Rows[0]["Salt_Password"].ToString();
string password = HashPassword(txtPassword.Text, salt);
SqlCommand com11 = new SqlCommand("For_Login1", con);
com11.CommandType = CommandType.StoredProcedure;
com11.Parameters.AddWithValue("@User_Id", ddl.SelectedItem.Text);
com11.Parameters.AddWithValue("@Password", password);
SqlDataAdapter sda = new SqlDataAdapter(com11);
DataTable dtcheck = new DataTable();
sda.Fill(dtcheck);
if (dtcheck.Rows.Count > 0)
{
}
else
{}
but still goes in else block. where I am making mistake?