Monday, March 19, 2012

ExecuteNonQuery Fails catastrophically

I was trying an RDA Demo project. However, everytime I pull the data from Sql Server 2005 and then move on to add a row to the table using SqlCeCommand.ExecuteNonQuery(), the application fails catastrophically without giving any exception and simply exits!

When I have pulled the data once and this application has shut down (exited) I can open it again and then continue normally but I can't expect the application to PULL the data and then even add or update a row to that table. I can do select queries fine. Why would this happen?

I am disposing all the objects that I use in both the scenarios, or atleast I believe so.
Does any one have any idea?For anyone else having the same problem -
The solution is to refrain from deleting the database manually through code and also to refrain from creating the database through code. Somehow it interferes with the ExecuteNonQuery later on. From what I have made out from my research it happens mostly with Emulators. Shouldn't be an issue with real device.

No comments:

Post a Comment