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


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

 <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

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

Reply via email to