-->
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.  [ 5 posts ] 
Author Message
 Post subject: How to navigate in record?
PostPosted: Mon May 28, 2007 2:14 am 
Newbie

Joined: Sat Apr 21, 2007 2:12 am
Posts: 16
Hi

I have four buttons on my window. Next, Previous, Last, First...On clicking on each of them, I want to navigate in record. For example if I click on Next, next record should be fetched and if Last is clicked , Last record should be fetched and its corresponding values should be shown in corresponding controls like textbox etc. But I am not able to do this through Nhibernate. Please help me.

Thanks

Gaurav


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 30, 2007 5:47 am 
Newbie

Joined: Sat Apr 21, 2007 2:12 am
Posts: 16
I am still searching for solution. Please help.

_________________
Gaurav Bhatia
http://www.viennasolutions.com/index.php


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 30, 2007 1:14 pm 
Regular
Regular

Joined: Sun Jan 21, 2007 4:33 pm
Posts: 65
If IDs are stored by Integer, simply start at 1 (First Record Button), and Have the 'next' increase the integer by one, and issue another Get<> when that happens. I dunno exactly how to grab the last record, besides using straight ADO.NET.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 31, 2007 6:14 am 
Newbie

Joined: Sat Apr 21, 2007 2:12 am
Posts: 16
Hi Gortok
Thanks for your reply.
Well the problem has been solved. It needs only this much code

ISession session = null;
session = DbFactory.NHSession;

IList companies = session.CreateQuery(" FROM Customer ").List();
this.customerBindingSource.DataSource = companies;

this.customerBindingSource.MoveNext();
or anything you want to do...next, last previous.

This code will be written after binding controls with presistent class.

Thanks

_________________
Gaurav Bhatia
http://www.viennasolutions.com/index.php


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 31, 2007 10:46 am 
Regular
Regular

Joined: Sun Jan 21, 2007 4:33 pm
Posts: 65
Gaurav Bhatia wrote:
Hi Gortok
Thanks for your reply.
Well the problem has been solved. It needs only this much code

ISession session = null;
session = DbFactory.NHSession;

IList companies = session.CreateQuery(" FROM Customer ").List();
this.customerBindingSource.DataSource = companies;

this.customerBindingSource.MoveNext();
or anything you want to do...next, last previous.

This code will be written after binding controls with presistent class.

Thanks


... I forgot about that...

Damn.


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

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.