protected void Button1_Click(object sender, EventArgs e) { count++; int noofcount = count; Label6.Text = noofcount.ToString(); if (noofcount > 5) { string ch = "Attacker"; con = new SqlConnection("Data Source=Database; Initial Catalog=firecol; User Id=sa; Pwd=password"); con.Open(); cmd = new SqlCommand("update normaluser set type='" + ch + "' where username='" + Label5.Text + "'", con); cmd.ExecuteNonQuery(); con.Close(); count=0; } else {String bl = "", la = ""; con = new SqlConnection("Data Source=FABSYS39\\SQLEXPRESS; Initial Catalog=firecol; User Id=sa; Pwd=saadmin"); con.Open(); cmd = new SqlCommand("Insert into questions Values('" + Label5.Text + "','" + ddldetails.SelectedItem.Text + "','" + DropDownList2.SelectedItem.Text + "','" + TextBox1.Text + "','" + la + "','" + bl + "')", con); cmd.ExecuteNonQuery(); con.Close(); Label4.Visible = true; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)