473,320 Members | 1,839 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Searching Dataset

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?
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #1
1 892
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,

--
Scott
http://www.OdeToCode.com

On Fri, 13 Aug 2004 07:51:59 -0700, Bijoy Naick
<b_*****@donoteamil.yahoo.ca> wrote:
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?
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Mario Rodriguez | last post by:
Hi I am trying to search activeDirectory through OLEDB and I am getting the exception like this DB_E_NOTABLE(0x80040E37) at OleDbDataAdapter.Fill method. My code look like this. ...
1
by: David | last post by:
Hello, I use the VS .NET 2003. Say I have a Windows form (with C# code, of course) which is connected to a database to one table. I can browse through the records, but I don't know how to...
5
by: David Wender | last post by:
I want to create a dataview with a sort on multiple columns. However, when I use FindRows, I only want to search some of the columns, not all. Is this possible? I have not been able to make it...
33
by: Geoff Jones | last post by:
Hiya I have a DataTable containing thousands of records. Each record has a primary key field called "ID" and another field called "PRODUCT" I want to retrieve the rows that satisy the following...
0
by: Peter Newman | last post by:
VB.Net 2003 & SQL2005 Ive been trying to find a way to search a Dataset for a value in a colum then move the currency manager to that row ? ie search for "211001" in the Column "Licence" ...
0
by: Muhammad Shoaib | last post by:
Hello Everybody! I'm using vb.net 2005 and MSSQL Server 2000 as back end i have little problem while i want to show only the data which i want, it gievs me problem infact i want to place a select...
5
by: Gowri | last post by:
Hello, I've been reading about ElementTreee and ElementPath so I could use them to find the right elements in the DOM. Unfortunately neither of these seem to offer XPath like capabilities where...
2
by: dibblm | last post by:
I'll start this hopefully simple and add code where needed or requested. Im using a combobox that bound to a DataSet. The Dataset retreives it's values from SQL. I can retreive the values...
1
by: gobblegob | last post by:
Hello Folks, I am searching a XML file for <Asset_Number> and then adding all children to DataGridView1, i can search but i dont know how to add item to the DataGridView Also my datagridview...
0
by: PeterSummer | last post by:
Could someone answer a vb.net database question? what is a good way to code a form so that a user could navigate through a dataset ie: MoveFirst, MoveNext, MovePrevious, MoveLast, Update and...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.