Hi, probably a newby question , but i'm new to NHibernate and google leaves me clueless.
The problem is that everything seems to be allright, but then it throws an exception like:
could not insert: [TestProject.Cat][SQL: INSERT INTO Cat (Name, Sex, Weight) VALUES (?, ?, ?)]
Notice the questionmarks.. The Cat object that goes in, has its values set.
I basically used the example of the nhibernate_reference.pdf.
I'm using NHibernate 1.2 on VS2005. tried the mapping from the reference, also generated the mappings and objects with NHibernate plugin for VS 2005, but the exception remains.
It's not a web project by the way, but a windows forms application.
Configuration in app.config
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property>
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="connection.connection_string">Data Source=myservername\SQLEXPRESS;Initial Catalog=Testdb;Integrated Security=True</property>
<mapping assembly="TestProject" />
</session-factory>
</hibernate-configuration>
The mapping and persistant object (Cat) is from the reference. I also tried to make the properties virtual, with no success.
Please help,
Frank
|