protected void Button1_Click(object sender, EventArgs e) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "insert tbstudent values(@q,@w,@ww)"; cmd.Connection = con; cmd.Parameters.Add("@board_m", SqlDbType.VarChar, 50).Value = TextBox9.Text; cmd.Parameters.Add("@q", SqlDbType.VarChar, 50).Value = TextBox10.Text; cmd.Parameters.Add("@w", SqlDbType.Float).Value = TextBox11.Text; cmd.Parameters.Add("@ww", SqlDbType.Float).Value = TextBox12.Text; float m1 = Convert.ToInt32(TextBox11.Text); float m2 = Convert.ToInt32(TextBox12.Text); float m3 = (m1 / m2) * 100; cmd.Parameters.Add("@per_m", SqlDbType.Float).Value = m3; Label1.Visible = true; Label1.Text = Convert.ToString(m3); cmd.ExecuteNonQuery(); cmd.Dispose(); }
button
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)