protected void BtnSubmit_Click(object sender, EventArgs e) { DatabaseConnection.DataConnection connection = new DatabaseConnection.DataConnection(); connection.AddQuery("insert into ContactRecord values('" + txtUser.Text + "','" + txtEmail.Text + "','" + txtMob.Text + "','" + txtMsg.Text + "')"); res.InnerHtml = "Thanks for the query we will contact you soon ! "; txtEmail.Text = ""; txtMob.Text = ""; txtMsg.Text = ""; txtUser.Text = ""; }
protected void BtnSubmit_Click(object sender, EventArgs e) { DatabaseConnection.DataConnection conection = new DatabaseConnection.DataConnection(); String serchQuery = "select * from LoginRecord where UserName='******' and UserPassword='******'"; DataTable tbl = new DataTable(); tbl = conection.Fetch_Record(serchQuery); if (tbl.Rows.Count > 0) { Response.Redirect("MainArea.aspx"); } else { res.InnerHtml = "Try to fill correct User name or password "; } }