Searching Dataset

  • Thread starter Thread starter Bijoy Naick
  • Start date Start date
B

Bijoy Naick

I have a query whcih returns a dataset. the dataset looks something like
this..

Country, NumEvents
1,0
2,7
3,23
4,3


Given a country ID (1..4), how can I find the corresponding NumEvents
value.

For example, I want to do something like (assuming country ID 3
corresponds to Canada)..

canada.text = myDS.Tables(0).FindValue("country = 3")

Whats the right approach?
 
Hi Bijoy:

Take a look at the DataTable Select method. This will return a row
matching an expression, than you can pull out the other values you
need from that row.

HTH,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top