These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Controlling program flow based on the result of a dao.getby
PostPosted: Mon Nov 23, 2009 11:46 am 
Newbie

Joined: Mon Nov 23, 2009 11:41 am
Posts: 1
Hey guys,

Im trying to figure out how to control the program flow using a getbyid() call. I need to control the programs flow so that if the object exists i can put the data to some web controls, if it does not exist then i need the program to continue as normal. I would like to do this without a try and catch clause in my code.

This doesnt work but it might give you an idea of what i mean:

Code:
IProfileDao pdao = DaoFactory.GetProfileDao();

if (pdao.GetProfileByOnePassId(Int32.Parse(returnvalue)) != null)
{
// fill out page controls
}
else
{
//dont do anything
}



Anyone any ideas?

Thanks
Dave


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


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

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.