-->
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 query sybase
PostPosted: Wed Aug 03, 2011 1:52 am 
Newbie

Joined: Wed Aug 03, 2011 1:50 am
Posts: 1
Have started to use NHibernate on sybase ASE data, problem am facing is when I load entity I get below error

"System.IndexOutOfRangeException : Invalid index 0 for this OdbcParameterCollection with Count=0."

This is how I configure session

Code:
properties["connection.provider"] = "NHibernate.Connection.DriverConnectionProvider"; properties["connection.driver_class"] = "NHibernate.Driver.OdbcDriver"; properties["connection.connection_string"] = @"Driver={Adaptive Server Enterprise};server=;port=; db=;uid=;pwd="; properties["dialect"] = "NHibernate.Dialect.SybaseASE15Dialect";   


and object mapping

Code:
<class name="MenuGroup" table="MENU_GROUP">     <id name="Id" column="id" type="Int32">       <generator class="identity" />     </id>         <property name="Name" column="name" type="String" length="100" not-null="true" />     <property name="Position" column="position" type="Int32" />     </class>



and If I do

Code:
var menuGroup = _session.Get<Menu.MenuGroup>(1);

I get error

NHibernate.Exceptions.GenericADOException : could not load an entity: [DomainModel.Menu.MenuGroup#1][SQL: SELECT menugroup0_.id as id1_0_, menugroup0_.name as name1_0_, menugroup0_.position as position1_0_ FROM MENU_GROUP menugroup0_ WHERE menugroup0_.id=?] ----> System.IndexOutOfRangeException : Invalid index 0 for this OdbcParameterCollection with Count=0.


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.