Dim sqlstr As String = "insert into kc(dm,rq,sl) values(@ming,@c,@d)"
Dim comm As SqlCommand = New SqlCommand(sqlstr, conn)
comm.Parameters.Add("@ming", SqlDbType.Text).Value = TextBox2.Text
comm.Parameters.Add("@c", SqlDbType.DateTime).Value = TextBox3.Text
comm.Parameters.Add("@d", SqlDbType.Int).Value = TextBox4.Text
conn.Open()
comm.ExecuteNonQuery()
conn.Close()
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
MessageBox.Show("添加完成", "提示")
Dim comm As SqlCommand = New SqlCommand(sqlstr, conn)
comm.Parameters.Add("@ming", SqlDbType.Text).Value = TextBox2.Text
comm.Parameters.Add("@c", SqlDbType.DateTime).Value = TextBox3.Text
comm.Parameters.Add("@d", SqlDbType.Int).Value = TextBox4.Text
conn.Open()
comm.ExecuteNonQuery()
conn.Close()
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
MessageBox.Show("添加完成", "提示")