PDA

Click to See Complete Forum and Search --> : SqlServerCe Crashes


Dmyze
Oct 4th, 2005, 03:39 PM
I have created an app that uses SQL Server CE, it's pretty cool, and way faster then the way I was doing it before.

However around every 120-130 updates it sends an error System.Data.SqlserCe.SqlCeException. (Note it crashes on a Query, so for each update there is one query so it's really around 240 sql queries when it dies.) The error message does not offer many details. I have to exit all the way out of the application before it will let me make another connection to the DB without crashing.

I thought maybe it was a ram issue and added a bunch of GC.Collect Statements but it did not help. I am using a Symbol MC 1000 and so I installed the software onto a PPT 8800, which has more ram. But I still got the same error at the same place.

I wouldn't even mind If I just had to reset the SQL connection, but I can not get it to connect to the SQL CE DB unless I exit all the way out of my program.

Shaggy Hiker
Oct 4th, 2005, 05:55 PM
If you are sure that your SQL is correct, can you trap the error and repeat if necessary?

Dmyze
Oct 4th, 2005, 06:01 PM
It doing the exact same thing, over and over again.

Select Row, UpdateRow.

I am re-writing the way I do my connection. so far I am reusing the same connection, I am going to have it open and close the connection with each query and see if that makes a difference.

Dmyze
Oct 5th, 2005, 01:26 PM
I fixed it. Instead of reusing the same connection, I close and open the connection for each set of queries. It's a little slower, but it does not crash.