各位朋友,我用DataTable在更新数据的时候,数据老是修改不了...帮我看看是怎么搞的..代码如下
<--得到Index
int rowIndex =0;
int colindex = 3;
<--得到要更新的内容...
int NewValue=Int32.Parse(((TextBox)this.GridView1.Rows[e.RowIndex].Cells[3].Controls[0]).Text);
<--经测试.此时NewValue已经取得了新的内容....<--更新数据
dt.Rows[rowIndex].ItemArray.SetValue(NewValue,colindex);
<--打印结果,可还是老值...
Response.Write(dt.Rows[rowIndex].ItemArray.GetValue(colindex).ToString ());
各位朋友,我哪里有错的地方??????
<--得到Index
int rowIndex =0;
int colindex = 3;
<--得到要更新的内容...
int NewValue=Int32.Parse(((TextBox)this.GridView1.Rows[e.RowIndex].Cells[3].Controls[0]).Text);
<--经测试.此时NewValue已经取得了新的内容....<--更新数据
dt.Rows[rowIndex].ItemArray.SetValue(NewValue,colindex);
<--打印结果,可还是老值...
Response.Write(dt.Rows[rowIndex].ItemArray.GetValue(colindex).ToString ());
各位朋友,我哪里有错的地方??????
解决方案 »
- 这个sql语句啥意思? 没怎么看懂。。。
- 关于访问数据的代码,请帮忙看一下!!!
- vs 2003开发的网站上传后以后本地更新程序后可以只上传某个.dll及相关页面吗?
- 请教:用VS2003新建的WEB用户控件为什么不能向VS2005建立的一样能在VS2005中直观的看见用户控件的属性。而不用到HTML模式下做编辑。。。
- 下载时的下载文件名变成了页面名,该如何解决
- 为何我的.net里datagrid的编辑、更新、取消按钮列不起作用?
- 这样的request参数都传不过来?高手救命啊!!!
- 如何判斷textBox中輸入的是字符還是數字?
- 网站如何防止音频被下载求教!!!
- asp.net网站空间需求
- asp.net判断文件是否被打开
- 帮我看看错在哪了?
然后在绑定~
Response.Write(dt.Rows[rowIndex][colindex ].ToString ());
dt.Rows[rowIndex][colindex ]=NewValue
这么写就可以..问题解决了.谢谢各位....