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();
}
{
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();
}
解决方案 »
- <运用C#编程通过OPC方式实现PC机与西门子PLC通讯>的例子中的GetGroupByName函数找不到?
- .net导出excel时加密
- 入库出库问题
- 请教一个问题
- 穷人求救:我的分没有了,可是还想再发一个问题,有分的时候再加给你们吧,请看看……
- 查找excel一列不为空的数据量
- 查询数据时,显示等待图片
- 奇怪现象,难道是BUG:comboBox1_KeyPress 执行完后有时候触发comboBox1_SelectedValueChanged,有时候不触发!
- 如何实现获得时间间隔范围内所有的日期
- 请问如果输入验证改用脚本来写,在C#中这些脚本写在哪里?
- ==SOS== 我的系统被什么占用了? ==SOS==
- 急聘项目经理、技术经理、高级程序员
{
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自动更新。
}
}