Question Locked

not storing correct value in sql server from a vb.net application

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hello,

I have a vb.net application that runs on a server. There are five client PC's that are connected to the server and all the data is saved on the server from my vb.net application.

To add a record, two sql runs under Commit transaction. One runs an insert statement while the other updates a record.

However, I have noticed a error. The update statement has lot of other fields which are stored correctly, but sometimes (say one out of 100 record) it doesnt stores the correct value to a numeric field. This field is integer and the data is stored from a text box.

This is creating a lot of trouble in my application. Please help.

2 replies

by thumbsup2

I've bumped into this same problem in MySQL. If the field is defined as integer, is it possible the number being pulled from the text box exceeds the maximum for that data type? If so, you'll get unexpected results.

In MySQL, the "integer" data type is capable of storing a number between -2147483648 and 2147483647 (signed) or between 0 and 4294967295 (unsigned). I can't find any reference at MS to see if SQL has the same restrictions as MySQL, but I suspect that it does.

You might try increasing the integer data type to a biginteger or longinteger (whatever SQL calls it).

This discussion is closed to new replies.