2
Answers

Error in multi threading

Photo of Muhammad younas

Muhammad younas

13y
1.2k
1
i m developing an C# application using Sql CE
i get this error in multi threading
 (The data was truncated while converting from one data type to another. [ Name of function(if known) =  ])
when i use to update the table for a single statemnt there is no error but if i use multiple threads for table update i get this eror
Plz help me

Answers (2)

0
Photo of Vulpes
NA 98.3k 1.5m 13y
The most likely kind of data to be truncated is a string field (i.e. varchar) which is limited to 'n' characters.

If the error only shows up when using multiple threads, then one possibility is that the threads are concatenating stuff to a shared string variable, resulting in it exceeding the maximum size when the table is updated with its contents.

I may be way off beam but that's what I'd look for first.
0
Photo of Sam Hobbs
NA 28.7k 1.3m 13y
I would noit assume it is a threading issue. Truncated data seems to me to not be a threading issue. It might be totally coincidental that it happens when you are using threads and does not happen if you are not using threads. If it is a threads issue, then the likely cause is that you are doing something across threads that you are not supposed to do.

Regardless, it seems unlikely that anyone can help without more information and I don't know what additional information to ask for.