Author: billy_111 | Posted on: 1/27/2010 9:08:48 PM | Views : 267

Hi,
I have the following code. I simply want to select the security question and answer from the DB and do something if the result is true.
This is my code:-

protected void Button1_Click(object sender, EventArgs e) { Label1.Text = ""; SqlConnection conn; SqlCommand cmd; SqlDataReader myReader; string cmdString = "SELECT [question], [answer] FROM hussaini_users WHERE [question] = @question AND [answer] = @answer"; conn = new SqlConnection("Data Source=SQLB23.webcontrolcenter.com;User ID=wbsd;Password=*****"); cmd = new SqlCommand(cmdString, conn); cmd.Parameters.Add("@question", SqlDbType.Char).Value = DropDownList2.SelectedValue; cmd.Parameters.Add("@answer", SqlDbType.Char).Value = FormsAuthentication.HashPasswordForStoringInConfigFile(TextBox1.Text, "MD5"); con ...

Go to the complete details ...