Last post Nov 07, 2006 07:19 AM by vasiliy_t
Nov 06, 2006 06:09 PM|AlexB1318|LINK
Here's a strange one...
I'm adding a record to a sqlserverce database. The field datatype is Integer, and when the .AddRow method is called the value changes from 4 to 2. Must be a conversion issue, however, I get the same results with the following datatypes: short, Int16, and
Int32. When I debug oRow.Item("Tag") contains 4 after line 6, but then it changes to 2 after line 7!
Any ideas what i can do here, anyone?
Here's some code:
1 enum Vals as Integer
2 Added= 4
3 end enum
4 sub test()
5 Dim oRow As DataRow = DataTable1.NewRow
8 end sub
Nov 07, 2006 07:19 AM|vasiliy_t|LINK
Try to set integer value instead of enumeration value.
oRow.Item("Tag") = 4
If it's work try CInt function for convertation.
Otherwise you have table definition problem.