怎么取得GridView绑定列中选定那一行要删除的数据对应的ID?
就是在GridView里有一模板列,列中有一按钮,点击后删除相应的记录
就是在GridView里有一模板列,列中有一按钮,点击后删除相应的记录
解决方案 »
- c# Web导出Excel
- 关于回调的问题!
- 请问一下,ASP.NET可以判断是不是来着手机的访问吗,谢了
- 请问我这个存储过程没有没有漏洞呢?
- 请教!怎样可以得到刚刚插入数据库的那条记录的标识ID
- 急!关于repeater中链接不同页面的问题。
- 如果将文本编辑器中的8万字小学保存到 MS SQL 2000 中
- 发送邮件遇到的错误,请高手指教~
- 661的输出错误???帮我解决下....
- 怎样找到Datagrid的页眉中的TextBox控件阿?我用DataGrid.Controls(0).Controls(0).findControl("TextBoxName"),但是不行阿
- 求助:一个读取Hashtable中数据的难题!!
- 在.NET2.0用户控件如何访问所属Page对象(没分了,有了一定补上)
{
SqlConnection con = DB.createConnection();
con.Open();
string sesName = Session["UserName"].ToString();
string mySql = "select ID from UserContent where UserName=('" + sesName + "')";
SqlCommand cmd = new SqlCommand(mySql,con);
int theUserID = Convert.ToInt32(cmd.ExecuteScalar());
SqlDataAdapter sdr = new SqlDataAdapter("select * from zsInfo where UserID=" + theUserID, con);
DataSet ds = new DataSet();
sdr.Fill(ds,"my");
this.gvZs.DataSource = ds.Tables["my"].DefaultView;
this.gvZs.DataKeyNames = new string[]{"ID"};
this.gvZs.DataBind();
con.Close(); } protected void gvZs_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
string myVar = this.gvZs.DataKeys[e.RowIndex].Value.ToString();
}myVar还是取不到值啊! hedongfu兄,有没有这方已经成功的源码,贴出来看看好吗?
没有这个属性啊?我用的是VS2005,难道没有人成功实现过这个功能吗?