public string forgotpassword(string tutor_username, string tutor_email) { SqlConnection con = new SqlConnection(StrCon); SqlCommand cmd = new SqlCommand(); con.ConnectionString = StrCon; //DataSet resultds = new DataSet(); cmd.Connection = con; cmd.CommandType = CommandType.StoredProcedure; //SqlDataAdapter da = new SqlDataAdapter(); cmd.CommandText = "tutor_Retrievepassword"; cmd.Parameters.Add("@tutor_username", SqlDbType.NVarChar).Direction = ParameterDirection.Input; cmd.Parameters.Add("@tutor_password", SqlDbType.NVarChar).Direction = ParameterDirection.Output; cmd.Parameters.Add("@tutor_email", SqlDbType.NVarChar).Direction = ParameterDirection.Input; cmd.Parameters["@tutor_username"].Value = tutor_username; //cmd.Parameters["@password"].Value = password; cmd.Parameters["@tutor_email"].Value = tutor_email; // da.SelectCommand = cmd; try { con.Open(); cmd.ExecuteReader(); return cmd.Parameters["@tutor_password"].ToString(); // da.Fill(resultds); } catch (Exception ex) { throw ex; // return null; } finally { cmd.Dispose(); con.Close(); con.Dispose(); } //return resultds; }
cmd.ExecuteReader()
cmd.Parameters["@tutor_email"].Size = tutor_email.Length; cmd.Parameters["@tutor_username"].Size= tutor_username.Length;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)