Click here to Skip to main content
15,886,714 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How can i read all the values from a datagrid for a particular id ?

Hi,

i have a datagrid with 6 columns one of the columns is the id column.

i want to read all the values from the datagrid having same id -> for example: id = 4

and i want to store all the values in a different string.

like, if i have 2 rows

this means i have 12 cells



that's it




now, i want all the 12 values in a different string for further use.... Thanks, Waiting for your Answer....
Posted
Updated 20-Apr-14 0:09am
v4
Comments
syed shanu 18-Apr-14 5:01am    
Is your gridview datasource from dataset or datatable.The you can filter the datatable or dataview.
Chk this links http://pankajlalwani.wordpress.com/2010/02/08/using-dataview-rowfilter-syntax-in-asp-net-c/
http://msdn.microsoft.com/en-us/library/zk13kdh0(v=vs.71).aspx
Rahul VB 20-Apr-14 6:13am    
Hello Brother,
Firstly,
Is it gridview or a datagrid? because gridview is an advancement of datagrid. Datagrid was present in 1.x framework and also is present in 3.5 framework for backward compatibility. So be clear brother.

Secondly,
I will give you the steps try to follow them: use a datasource : for example an sqldatasource, Now to your control assign the id of the datasource.

Now in the select command: say "select * from table_name where some_condition";

Try to search and implement.
Thanks,
Rahul

1 solution

If you want to use LINQ, this link[^] may help you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900