•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the C# section within the Software Development category of DaniWeb, a massive community of 426,480 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,170 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C# advertiser: Programming Forums
Views: 397 | Replies: 2
![]() |
•
•
Join Date: Sep 2006
Posts: 104
Reputation:
Rep Power: 3
Solved Threads: 0
I have a datatable which is having n no. of rows and each row has a unique field say ID.
Now I want to get a particular row for a specified ID.
eg. there are 5 rows in a datatable and the id's are
1,2,3,4 and 5 and if I want to select a row having ID = 4
What will be the code snippet for that?
Does anybody have any idea?
Thanks in advance,
Now I want to get a particular row for a specified ID.
eg. there are 5 rows in a datatable and the id's are
1,2,3,4 and 5 and if I want to select a row having ID = 4
What will be the code snippet for that?
Does anybody have any idea?
Thanks in advance,
•
•
Join Date: May 2006
Posts: 6
Reputation:
Rep Power: 0
Solved Threads: 1
•
•
•
•
I have a datatable which is having n no. of rows and each row has a unique field say ID.
Now I want to get a particular row for a specified ID.
eg. there are 5 rows in a datatable and the id's are
1,2,3,4 and 5 and if I want to select a row having ID = 4
What will be the code snippet for that?
Does anybody have any idea?
Thanks in advance,
Other than the obvious datatable.Rows[3]
you can do a Select within the table
DataRow[] rws = datatable.Select("ID=4");
![]() |
•
•
•
•
•
•
•
•
DaniWeb C# Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Other Threads in the C# Forum
- Previous Thread: SelectedValue of dropdownlist is not saved when the page is loaded first time
- Next Thread: refernce website code


Linear Mode