How to Get a Specific Column Value from a DataTable?

Posted by peace on Stack Overflow See other posts from Stack Overflow or by peace
Published on 2010-05-26T20:35:31Z Indexed on 2010/05/26 21:11 UTC
Read the original article Hit count: 265

Filed under:
|
|

I have a datatable. I need to fetch a certain column value based on the user input. For example, lets say the datatable has two columns CountryID and CountryName.

I need to find CountryID in the datatable based on the user input country name. I could just open a connection with DB and run the query select countryID from Country where countryName = @userinput. Is there anyway i could do this on the datatable.

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET