int index = this.dataGridView1.CurrentCell.RowIndex;//获得焦点所在的行的索引
DataRow row = this.dataSet.Tables["Customer_tb"].Rows[index];// 获取表中当前行
strselect = row[0].ToString(); //当前行的第一个值
editform neweditform = new editform();
neweditform.Show();
this.Visible = false;问题出在
DataRow row = this.dataSet.Tables["Customer_tb"].Rows[index];// 获取表中当前行
请高人指点 谢谢
DataRow row = this.dataSet.Tables["Customer_tb"].Rows[index];// 获取表中当前行
strselect = row[0].ToString(); //当前行的第一个值
editform neweditform = new editform();
neweditform.Show();
this.Visible = false;问题出在
DataRow row = this.dataSet.Tables["Customer_tb"].Rows[index];// 获取表中当前行
请高人指点 谢谢
解决方案 »
- dataGridView 同步更新问题!
- 为什么存储过程,输出参数值总是整数?
- aspx.cs页里怎么写switch case 求个标准的语法格式
- 使用反射统一返回Ilist<T>的一些疑问
- 在c#中用html语法编辑好的代码,如果这时候切换一下到design界面然后再切换回来,有可能一些较长的代码会被系统自动调整为两行,这个功能很讨厌,如何取消呢?
- 关于反射的一个问题
- Winform DataGrid 样式存储问题.
- 棘手问题,通过窗体(form)如何获取一个网站的html代码??分布多了。在线等
- 请教WinForm打开WebForm的方法(Windows Moblie IE)
- 如何在字符串中加入一个引号呀
- 能不能对已存在的.net类扩充或重载函数,不继承.
- image控件和textbox控件联动
而 DataRow row = this.dataSet.Tables["Customer_tb"].Rows[index] 没有结果.为null
我很迷惑..
dataGridView1和dataSet.Tables["Customer_tb"]访问的是同一个表么?
//这句是获取DataGridView中数据表格的行号
int index = this.dataGridView1.CurrentCell.RowIndex 执行有结果. //这句是获取数据源中的记录行
DataRow row = this.dataSet.Tables["Customer_tb"].Rows[index];// 获取表中当前行 没看到DataSet数据绑定到DataGridView的代码。。
DataSet获取数据之后,把数据源绑定到DataGridView,这样就是同一个数据源了,二者之一有数据那另外一个也就有数据了。