this.sqlInsertCommand2.Parameters["@Id"].Value=textBox1.Text;
this.sqlInsertCommand2.Parameters["@name"].Value=textBox2.Text;
this.sqlInsertCommand2.Parameters["@Sex"].Value=textBox3.Text;
this.sqlInsertCommand2.Parameters["@Age"].Value=textBox4.Text;
this.sqlInsertCommand2.Parameters["@Telephone"].Value=textBox5.Text;
this.sqlInsertCommand2.Parameters["@Code"].Value=textBox6.Text;
this.sqlInsertCommand2.Connection.Open();
this.sqlInsertCommand2.ExecuteNonQuery();
this.sqlInsertCommand2.Connection.Close();
this.sqlConnection1.Open();
this.sqlDataAdapter2.Fill(this.dataSet11);
this.sqlConnection1.Close();
this.dataGrid1.Update();
this.dataGrid1.Refresh();
this.textBox1.Text="";this.textBox2.Text="";
this.textBox3.Text="";this.textBox4.Text="";
this.textBox5.Text="";this.textBox6.Text="";
就是类似这样的.其他的都是一个原理.