Hello,
I have a C# Windows Forms application. I am using Fluent NHibernate. I am new to both. I have a MS SQL database with a table (no foriegn keys) with the primary key column as an 'Identity' column. In the Mapping I have tried: Id(x=>x.Id) and Id(x=>x.Id).Generatedby.Identity() and Id(x=>x.Id).Generatedby.Native().
While debugging I can see that the entity is populating fine for a new record with Id=0, but, when I call session.Save(<entity>); it results in System.ApplicationException - Details:could not insert - with table name and it's columns listed and ending with "select SCOPE_IDENTITY()".
I am not sure if it is not able to insert because of identity column or any other issue as there is no further detail in the exception stack trace.
Please help.
Thanks in advance.
1 Replies - 1319 Views - Last Post: 05 October 2011 - 10:38 AM
#1
C# Winform Fluent NHibernate - getting could not insert exception
Posted 05 October 2011 - 05:29 AM
Replies To: C# Winform Fluent NHibernate - getting could not insert exception
#2
Re: C# Winform Fluent NHibernate - getting could not insert exception
Posted 05 October 2011 - 10:38 AM
hi
what inner exception tells? when i was setting up a code sample to reproduce your error i had an error like yours. the problem was in table and class name, they were different
what inner exception tells? when i was setting up a code sample to reproduce your error i had an error like yours. the problem was in table and class name, they were different
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote



|