cint(e.Item.Cells[3].Controls[0]).Text)
解决方案 »
- 为什么使用了模版替换文件后js中的innerHTML就不能正常工作了
- 为啥IE6的‘目标另存为’不能下载,火狐的‘链接另存为’可以下载?
- 怎么让 command.ExecuteNonQuery 返回影响的行数?
- 一句话可以解决的问题 关于LABEL
- 有没有办法让页面自动跳转回上一级页面(有两个页面可以同时跳转到这个页面),其实就是后退的效果!
- 请各位帮小妹看看这个问题下载对话框的问题怎么实现?多谢!
- 挑战一下你的数据库查询能力!
- 一个简单的页面格式的显示问题(关于回车换行的)
- 为什么安装vs.net2003之后以前的asp程序不能进行写Access数据库的操作了?
- hot ----框架问题..asp.net+vb.net
- 急,我的.net不能调试了,那位大哥给看看!!!!!!!
- 50元出售全新wrox<<ASP.NET编程起步(C#)>>
int b=Convert.Convert.ToInt32(a);
string strSQL="update order_info set order_num="+b+" where order_id="+DataGrid1.DataKeys[(int)e.Item.ItemIndex];
+ "address = @Address, city = @City, state = @State, zip = @Zip, contract = @Contract where au_id = @Id"; SqlCommand myCommand = new SqlCommand(updateCmd, myConnection); myCommand.Parameters.Add(new SqlParameter("@Id", SqlDbType.NVarChar, 11));
myCommand.Parameters.Add(new SqlParameter("@LName", SqlDbType.NVarChar, 40));
myCommand.Parameters.Add(new SqlParameter("@FName", SqlDbType.NVarChar, 20));
myCommand.Parameters.Add(new SqlParameter("@Phone", SqlDbType.NChar, 12));
myCommand.Parameters.Add(new SqlParameter("@Address", SqlDbType.NVarChar, 40));
myCommand.Parameters.Add(new SqlParameter("@City", SqlDbType.NVarChar, 20));
myCommand.Parameters.Add(new SqlParameter("@State", SqlDbType.NChar, 2));
myCommand.Parameters.Add(new SqlParameter("@Zip", SqlDbType.NChar, 5));
myCommand.Parameters.Add(new SqlParameter("@Contract", SqlDbType.NVarChar,1)); myCommand.Parameters["@Id"].Value = MyDataGrid.DataKeys[(int)e.Item.ItemIndex];
……
倘若已经转换成可编辑状态,那么就要用:
Dim txta TextBox = e.Item.Cells(3).Controls(0)
dim b as integer =cint(txta.text)
(TextBox)e.Item.Cells[3].FindControl["文本控件的ID").Text
或者 把你的内容放到
if (e.Item.ItemIndex>=0)
{
//你的内容
}