NHibernate
-
Hi, I am using NHibernate to persist my objects. To delete an object from DB I have written the below code : public void Delete(T item) { try { using (ISession session = factory.OpenSession()) { using (session.BeginTransaction()) { session.Delete(item); session.Transaction.Commit(); //Code is breaking here. } } } catch (Exception e) { System.Windows.Forms.MessageBox.Show(e.Message); System.Windows.Forms.MessageBox.Show(e.StackTrace); } } The code is breaking at line session.transaction.commit(); with following error message "Unexpected row count: 0; expected: 1" Please let me know how to fix this. Thanks in Advance Regards Puneet
-
Hi, I am using NHibernate to persist my objects. To delete an object from DB I have written the below code : public void Delete(T item) { try { using (ISession session = factory.OpenSession()) { using (session.BeginTransaction()) { session.Delete(item); session.Transaction.Commit(); //Code is breaking here. } } } catch (Exception e) { System.Windows.Forms.MessageBox.Show(e.Message); System.Windows.Forms.MessageBox.Show(e.StackTrace); } } The code is breaking at line session.transaction.commit(); with following error message "Unexpected row count: 0; expected: 1" Please let me know how to fix this. Thanks in Advance Regards Puneet
-
Hi, I am using NHibernate to persist my objects. To delete an object from DB I have written the below code : public void Delete(T item) { try { using (ISession session = factory.OpenSession()) { using (session.BeginTransaction()) { session.Delete(item); session.Transaction.Commit(); //Code is breaking here. } } } catch (Exception e) { System.Windows.Forms.MessageBox.Show(e.Message); System.Windows.Forms.MessageBox.Show(e.StackTrace); } } The code is breaking at line session.transaction.commit(); with following error message "Unexpected row count: 0; expected: 1" Please let me know how to fix this. Thanks in Advance Regards Puneet
With a user name like that i bet you get a shit load of spam :rolleyes:
Harvey Saayman - South Africa Junior Developer .Net, C#, SQL
you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111 -
Hi, I am using NHibernate to persist my objects. To delete an object from DB I have written the below code : public void Delete(T item) { try { using (ISession session = factory.OpenSession()) { using (session.BeginTransaction()) { session.Delete(item); session.Transaction.Commit(); //Code is breaking here. } } } catch (Exception e) { System.Windows.Forms.MessageBox.Show(e.Message); System.Windows.Forms.MessageBox.Show(e.StackTrace); } } The code is breaking at line session.transaction.commit(); with following error message "Unexpected row count: 0; expected: 1" Please let me know how to fix this. Thanks in Advance Regards Puneet
Are you sure the record exists?
Mark Churchill Director, Dunn & Churchill Pty Ltd Free Download: Diamond Binding: The simple, powerful, reliable, and effective data layer toolkit for Visual Studio.
Alpha release: Entanglar: Transparant multiplayer framework for .Net games. -
Are you sure the record exists?
Mark Churchill Director, Dunn & Churchill Pty Ltd Free Download: Diamond Binding: The simple, powerful, reliable, and effective data layer toolkit for Visual Studio.
Alpha release: Entanglar: Transparant multiplayer framework for .Net games.Ya Record is there. Could you please let me know where I am going wrong. Thanks for your efforts.