hlw(天马) 兄弟 以下是你给我的代码:
private void dataGrid1_DoubleClick(object sender, System.EventArgs e) //双击进行编辑
{try
{
DataTable mytable;
DataRow myrow;
mytable=(DataTable)dataGrid1.DataSource;
myrow=mytable.Rows[this.dataGrid1.CurrentCell.RowNumber];
string facid=myrow[0].ToString(); //获得数据库中的ID值
}
后使用删除语句删除数据库ID=facid的值,就可以了
}
catch(Exception err)
{
MessageBox.Show(err.Message ,"信息提示:",MessageBoxButtons.OK,MessageBoxIcon.Information );
}
为什么提示转换无效,可以说详细点吗?
private void dataGrid1_DoubleClick(object sender, System.EventArgs e) //双击进行编辑
{try
{
DataTable mytable;
DataRow myrow;
mytable=(DataTable)dataGrid1.DataSource;
myrow=mytable.Rows[this.dataGrid1.CurrentCell.RowNumber];
string facid=myrow[0].ToString(); //获得数据库中的ID值
}
后使用删除语句删除数据库ID=facid的值,就可以了
}
catch(Exception err)
{
MessageBox.Show(err.Message ,"信息提示:",MessageBoxButtons.OK,MessageBoxIcon.Information );
}
为什么提示转换无效,可以说详细点吗?
解决方案 »
- System.Windows.Forms里的TIMER
- 求思路了~
- 使用dataGridView的FormattedValue代替Value,可以吗?
- 这个sql语句和存储过程怎么写?
- 急,web页面弹出错误对话框问题??
- 精度处理问题
- datagridview 如何设置或调整固定列的宽度
- 怎样取得当前计算机的时间?
- 求C# 线程写法
- 10月22日 .NET 框架和 Visual Studio.NET RC1 发布;11月 Visual Studio.NET RTM 发布;2002年2月 Visual Studio.NET 开始零售。
- 如何用WMI查询CPU使用率
- 100分求专门讲解c#实例的书-------winform 不要电子版的,要有出版社
是上面这一句错了吗?