用datatable的addrow来做,例如DataRow = this.Dataset1.Tables["表名"].NewRow();
DataRow["字段名1"]=this.textBox1.Text ;
DataRow["字段名2"]=this.textBox2.Text ;
this.Dataset1.Tables["设备修理记录"].Rows.InsertAt  (DataRow,this.equipmentDataset1.Tables["表名"].Rows.Count);

解决方案 »

  1.   

    对不起大家了,我没钱了,是winform里,难道用sqlcommand的SQL语句不能实现吗?
      

  2.   

    SqlConnection conn = new Sqlconnection( "conncetion string" );
    conn.open();int id = convert.ToInt32( this.textbox1.text );
    string name = this.textbox2.text;
    String command = "insert into table values(" + id + "," + name + ")";SqlDataAdapter dscommand = new SqlDataAdapter();
    dscommand.InsertCommand = new SqlCommand( command, conn );
     dscommand.InsertCommand.ExecuteNonQuery();