且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

检索gridview上的多个选定项选定索引已更改事件

更新时间:2021-12-29 22:52:29

您能解释一下,您的意思是什么,在gridview的每行中是否都有复选框或多个复选框?单行

如果在Gridview的每一行上选中一个复选框,然后将其作为模板列

然后,使用Grdivew Rowcommand,可以为每个循环执行.
Can you explain , what exactly u mean , do u have check box n each row of gridview or multiple check box on a single row

if you one check box on every row of Gridview and then make it as template column

Then using Grdivew Rowcommand , you can do the for each loop.



您应该按照以下步骤操作:
Hi,
You should follow these steps:
报价:

1.从gridview获取所有选定的行.
2.将其存储在用逗号分隔的字符串中.像(2,3,4,5)
3.现在在您的SQL查询中使用IN运算符.喜欢:
"SELECT * FROM stusub WHERE StuID IN ''" + GridviewSelectedRows + "'' ";
GridviewSelectedRows 是您要用逗号分隔的字符串.
4.现在从数据库获取记录集.

1. Fetch all the selected row from your gridview.
2. Store it in a string separated with comma. Like (2, 3, 4, 5)
3. Now use IN operator in your sql query. Like:
"SELECT * FROM stusub WHERE StuID IN ''" + GridviewSelectedRows + "'' ";
Here GridviewSelectedRows is the the string which you are framing with comma separation.
4. Now get the recordset from database.



请按照步骤操作,并尽力而为.
祝一切顺利.
--Amit



Follow the steps and try your best.
All the best.
--Amit