-->
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: Nhibernate Bag DataBinding
PostPosted: Mon Feb 13, 2006 3:53 pm 
Newbie

Joined: Sat Nov 05, 2005 1:51 pm
Posts: 3
Hibernate version: 1.02

Hi Guys,

Just need a little help with Nhibernate and Databinding with Windows Forms 2.0. In my XML file I have a one to many bag for a class. There is no lazy initialization. When I get the list for that type, the bag is populated properly.

The issue is that if the bag is empty with count=0 I have a databinding error:

"Cannot bind to the property or column PROPERTYNAME on the DataSource. Parameter name: dataMember".

I believe the reason this happens is because the bag is not typed and when there are no rows, it cannot find the propery and column within the bag. On the other hand, if the bag has count > 0, there are no issues, it binds perfectly.

Now, is there a way, I can say in the mapping file that if the bag count = 0 , then do not set the object IList property. What is the best way to fix this?

Regards,
Mike


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.