Click here to Skip to main content
15,949,686 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hey this is prakash

public void save(logcls lgcls)
        {
            ITransaction tx = null;
            try
            {
                if (!session.IsConnected)
                {
                    session.Reconnect();
                }
                tx = session.BeginTransaction();
                //lgcls.s
                session.Save(lgcls);
                tx.Commit();
                session.Disconnect();
            }
            catch (Exception ex)
            {
                tx.Rollback();
                session.Disconnect();
                // handle exception
            }
        }


I wrote this for storing the record in the sqlserver 2005 using the nhibernate but I am getting exception like "could not store the object".
Please help me, thank you.
Posted
Updated 21-Oct-10 3:36am
v2
Comments
Sandeep Mewara 21-Oct-10 10:25am    
What is 'logcls' object?
Keith Barrow 23-Oct-10 9:50am    
Could be a mis-mapping between the object and the database, referential integrity failure, some transactioning problem anything. What is the exact error message and where does it occur in the code?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900