private void AcceptChanges()
{
   DataSet myDataSet;
   myDataSet = new DataSet();   // Not shown: methods to fill the DataSet with data.
   DataTable t;
   t = myDataSet.Tables["Suppliers"];   // Add a DataRow to a table.
   DataRow myRow;
   myRow = t.NewRow();
   myRow["CompanyID"] = "NWTRADECO";
   myRow["CompanyName"] = "NortWest Trade Company";   // Add the row.
   t.Rows.Add( myRow );   // Calling AcceptChanges on the DataSet causes AcceptChanges to be
   // called on all subordinate objects.
   myDataSet.AcceptChanges();
}

解决方案 »

  1.   

    mydataset.tables[0].rows[0][0] 这样就可以任意的定位了
      

  2.   

    问题是只知道想要的指定column的值,而不知row的序号。
      

  3.   

    DataRow[] foundRows = myTable.Select(mcode="abc);
      

  4.   

    对 select 出来的rows进行更改,如何update到原来的table上 ?(不是update到数据库)
      

  5.   

    private void button1_Click(object sender, System.EventArgs e)
    {
    DataRow[] findrows;
    findrows=this.dataSet11.Tables [0].Select ("name='leo'");
    if (findrows.Length >0)
    {
    findrows[0][1]="90";
    //我的Table是这样的:|name||
                                               //   |leo  | 30|
                               //click button 后,name=leo;=90;Table自动更新。
    }
    }