I have a stored procedure which checks the username and the password from a SQL Server database table. The stored procedure returns 1 if the username and the password is correct or returns 0. Here is the code. Could you please tell me how can I get the 1 or 0 pls? The rdr.toString does not work.
SqlCommand cmd = new SqlCommand("sp_IsValidLogon", conn);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add(new SqlParameter("@Username", textBox1.Text));
cmd.Parameters.Add(new SqlParameter("@Password", textBox2.Text));
rdr = cmd.ExecuteReader();
label1.Text = rdr.ToString();
Try this
instead of this: