Esempio n. 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        ClassConnection NewConnection = new ClassConnection();

        NewConnection.Connection_Today();

        SqlCommand comm = new SqlCommand();

        comm.Connection = ClassConnection.conn;

        // There are two field in the table but int is (1,1) so parameter
        // is not required.
        comm.CommandText = "insert into Testing values (@name)";
        comm.Parameters.AddWithValue("name", TextBox1.Text);
        comm.ExecuteNonQuery();
    }