 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
kei Guest
|
Posted: Wed Jun 21, 2006 8:13 am Post subject: how to find a row in a QueryDataSet |
|
|
I have two queryDataSet, what I want to do is loop one
querydataset and for each row, find the corresponding row in
another queryDataset by a common fieldNames, the question seems
simple, but I don't know how to find a row based on a
fieldName. what I find is goToRow(int row), which seems not
suitable for my need (I need the parameter is a fieldName,
string, not row), is there any method?
Thx!! |
|
| Back to top |
|
 |
Kevin Dean [TeamB] Guest
|
Posted: Wed Jun 21, 2006 6:22 pm Post subject: Re: how to find a row in a QueryDataSet |
|
|
kei wrote:
| Quote: | I have two queryDataSet, what I want to do is loop one
querydataset and for each row, find the corresponding row in
another queryDataset by a common fieldNames, the question seems
simple, but I don't know how to find a row based on a
fieldName. what I find is goToRow(int row), which seems not
suitable for my need (I need the parameter is a fieldName,
string, not row), is there any method?
|
Here's some code I pulled out of one of my applications:
DataSet gamesDataSet = mainDataModule.getGamesDataSet();
DataSetView gamesDataSetView = gamesDataSet.cloneDataSetView();
try {
DataRow locateRow = new DataRow(gamesDataSetView, new String[] { "eventKey" });
locateRow.setInt("eventKey", eventsDataSet.getInt("eventKey"));
if (!gamesDataSetView.locate(locateRow, Locate.FIRST)) {
gamesDataSetView.close();
gamesDataSetView = null;
}
}
catch (DataSetException ex) {
gamesDataSetView.close();
throw ex;
}
--
Kevin Dean [TeamB]
Dolphin Data Development Ltd.
http://www.datadevelopment.com/
NEW WHITEPAPERS
Team Development with JBuilder and Borland Enterprise Server
Securing Borland Enterprise Server
http://www.datadevelopment.com/papers/index.html
Please see Borland's newsgroup guidelines at
http://info.borland.com/newsgroups/guide.html |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|