BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

how to find a row in a QueryDataSet

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> JBuilder DB Swing
View previous topic :: View next topic  
Author Message
kei
Guest





PostPosted: Wed Jun 21, 2006 8:13 am    Post subject: how to find a row in a QueryDataSet Reply with 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?

Thx!!
Back to top
Kevin Dean [TeamB]
Guest





PostPosted: Wed Jun 21, 2006 6:22 pm    Post subject: Re: how to find a row in a QueryDataSet Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> JBuilder DB Swing All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.