天天看點

Dataset.Tables[0].Select從一個Dataset中提取符合要求的資料

DataSet ds1= new DataSet();

DataTable dt1 = new DataTable();

dt1 = ds2.Tables[0].Clone();//複制ds2..Tables[0]表的架構

ds2.Tables[0].Select("答卷IP like '" + XmlstructCountry.strName + "*'").CopyToDataTable (dt1, LoadOption.PreserveChanges);//将好多行資料一次性複制到一張表裡

ds1.Tables.Add(dt1);//-将表添加到另外一個Dataset裡面