根据主健到dataset中去找
object[]findTheseVals = new object[主键数];
findTheseVals[0]=grid中主键1值;
findTheseVals[1]=grid中主键2值;
....
foundRow = dataset.Tables[0].Rows.Find(findTheseVals);
object[]findTheseVals = new object[主键数];
findTheseVals[0]=grid中主键1值;
findTheseVals[1]=grid中主键2值;
....
foundRow = dataset.Tables[0].Rows.Find(findTheseVals);
解决方案 »
- 小弟遇到急切难题。。。万望各位大大救命!
- 急急急!
- 为什么socket客户端发第二次消息就卡住不动,付代码
- 关于RowFilter的问题(过滤)
- 2005怎樣引用Excel,並且把兩個DataGridView的數據分別導入到Sheet1和Sheet2裡面。
- 如何在C#中调用VC++6.0编写的COM接口
- DataTable问题
- 关于webserver的讨论。。。。。
- 有关数据的问题:一个数据链接打开后,十多分钟不用它,为何会报"转换错误"不明白(附代码)
- 用EF多表查询时间,怎么让他返回list类型
- encType="multipart/form-data"
- 谁知道北京东方通科技这个公司如何?介绍一下,谢谢!
dataview中获得的数据与datagrid经过排序后是一一对应的然后通过this.dataview[this.currentCell.rownum]得到
的便是你所看到的数据
this.datagrid.DataSource = dataSet.Tables[0].DefaultView;
DefaultView的排序就会根据datagrid的排序.
int rowIndex = this.dataGrid.CurrentRowIndex;
//get id value
this.dataSet.Tables[0].select( "filter" )
// select dataRow from dataSet
这样做你的修改就不会受到排序的影响,
不过略麻烦一些