How to find forgot password from the database?

RobertL

New Member
i have one project in which i want to send forgot password mail but i am not able to find user name and password from the database it is sending blank mail like UserName : and Password : i want to find user name and password from the data base in 3 tier architecture thanks in advance and this is my code....\[code\] protected void Button1_Click(object sender, EventArgs e) { int id = MyRegistration.fgusername(txt_Email.Text.Trim()); if (id > 0) { string sQuery = "Select UserName, Password From Registration Where EmailID = '" + txt_Email.Text + "'"; DataSet ds =DataAccessLayer.ExeSelectQuery(sQuery); try { string sUserName = ""; string sPassword = ""; sendMail( sUserName, sPassword); } catch (Exception ex) { } } else { label1.Text = "Invalid User"; } }\[/code\]Data Access Layer :\[code\] public static int fgusername(string sEmailId) { int id1 = 0; string selectstr = "SELECT UserName, Password FROM Registration WHERE EmailID = '" + sEmailId.Trim() + "'"; id1 = DataAccessLayer.ExecuteReader(selectstr); return id1; }\[/code\]
 
Back
Top