By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,086 Members | 1,442 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,086 IT Pros & Developers. It's quick & easy.

how do you get a value...

P: n/a
hi,

How do you get a value, say a clientname, from a CLIENT table in a dataset
based on the clientid value in another table called ORDER through a data
relation called 'mydatarelation'? A CLIENT may have one or more ORDERS.

I have not been able to find any examples on this, can anybody help?
Cheers, Lerp
Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
This is some hacky code, but I am not sure exactly what you are wanting.

DataSet ds = //DataSet
DataTable tblClient = ds.Tables["ClientTable"];

//pull the clientid that you want to look up.
string clientID = GetClientID();

//You can do a select on the table to get the DataRows.
//it will return an array of DataRows that have the clientID equal to the
clientID.
DataRow [] rows = tblClient.Select( "clientID = " + clientID );

//also if the ClientID column is the PrimaryKey column for tblClients
DataRow row = tblClient.Rows.Find( clientID );

bill

"Lerp" <ad***@officience.ca> wrote in message
news:uH**************@TK2MSFTNGP12.phx.gbl...
hi,

How do you get a value, say a clientname, from a CLIENT table in a dataset
based on the clientid value in another table called ORDER through a data
relation called 'mydatarelation'? A CLIENT may have one or more ORDERS.

I have not been able to find any examples on this, can anybody help?
Cheers, Lerp

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.