cam978 wrote:
Hi
I am trying to insert some data from a web form into SQL 2005
but instead of inserting the code is updating which is generating an error
any suggestions????
Thanks
Are you using a generated id by any chance? I'm guessing you are generating your primary key values and not specifying the version or unsaved value correctly.
If NHibernate sees that you have an object with an Id which it would think would be an existing key it'll think you want to update (given you called SaveOrUpdate()). If you call Save() it should insert, Update() it should update.
Post your mapping file and classes if you need more help.