也可以用文本框来。实现的你参考我这个看看吧!
objSqlConn.Open();
string insCmd = "insert into student values(@StuNo,@StuName)";
SqlCommand objSqlCommand=new SqlCommand(insCmd,objSqlConn);
objSqlCommand.Parameters.Add("@StuNo", SqlDbType.Char).Value = this.txtName.Text;
objSqlCommand.Parameters.Add("@StuName", SqlDbType.Char).Value = this.txtNumber.Text;
objSqlCommand.ExecuteNonQuery();
MessageBox.Show("ok");