Help with SqlCeCommand not throwing exception on long query.

kuridit

New member
Joined
Dec 16, 2010
Messages
1
Programming Experience
Beginner
Hi,

I've got a problem with SqlCeCommand not throwing an exception when running a long delete statement.

the statement looks something like this (ive deleted out the middle part as its too long, but basically there are 2000 rows to be deleted)
DELETE FROM table1 WHERE someKey IN('000000000000', ...... ,'000000002000')

if i run it in debug mode it stops at ExecuteNonQuery() with no exception, but i do get an alert to say "remote connection to the device has been lost". it doesnt appear to be timeing out because it only lasts about 1 second before exiting. the code seems to be ok because if i try deleting only say 100 rows it works fine.

ive got my code surrounded with a try catch ex as Exception so this should catch all exceptions i would have thought?

is there a limit on the lenght of the command string?

also if i copy and past this delete statement directly into the database myself it works.
 
Back
Top