如何获取GridviewRows以及如何使用这些值SQL Update语句 [英] How to retrive the GridviewRows and how to use these values SQL Update Statement

查看:136
本文介绍了如何获取GridviewRows以及如何使用这些值SQL Update语句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,

如何获取GridviewRows以及如何使用这些值SQL Update语句

感谢您的宝贵意见,谢谢您的宝贵答复.

Dear All,

How to retrive the GridviewRows and how to use these values SQL Update Statement

Thank for advance, for ur valuable reply

推荐答案

您好,
请按照以下步骤操作

1.对于下一个循环,直到网格行计数.
2.将当前行值分配到数据行或其他变量中
3.只需使用适配器进行更新或构造查询并引发ExecuteNonquery.

就这样

Padmanaban.A
Hi
Please follow this steps

1. For next loop until the grid rows count.
2. Assign the current rows value into a data row or some other variable
3. Just update using adapter or construct query and raise an ExecuteNonquery.

That''s all

Padmanaban.A


使用rowcommand事件从gridview获取数据
to fetch data from gridview use rowcommand event
protected void fect_taskid(object sender, GridViewCommandEventArgs e)
   {

               int index = Convert.ToInt32(e.CommandArgument);
               GridViewRow row = GridView1.Rows[index];
               lblassinmentno.Text = row.Cells[1].Text;//assign any value of gridview cell by cell index
}


更新数据,请参见讨论
编辑,更新gridview中的行


to update data see discussion
edit,update row in gridview


选中此链接

选中此链接
Check this link

Check this link

Check this link


这篇关于如何获取GridviewRows以及如何使用这些值SQL Update语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆