G
Guest
I define a column X in table T as a Sqlint32 type:
table.Columns.Add("X", GetType(SqlInt32))
After the Dataset is filled from the source, I try to access the column:
Dim Y as SqlInt32
Y = dataset.tables("T")("X")
....but since I have OPTION STRICT ON the above won't work (trying to cast
Object to SqlInt32), so I explicity cast it:
Y = Ctype(dataset.tables("T")("X"), SqlInt32)
...but at runtime, the above Ctype throws an invalid cast exception.
I've tried all kinds of workarounds, but obviously I'm missing something
very basic... but what???
Thanks!
DT
table.Columns.Add("X", GetType(SqlInt32))
After the Dataset is filled from the source, I try to access the column:
Dim Y as SqlInt32
Y = dataset.tables("T")("X")
....but since I have OPTION STRICT ON the above won't work (trying to cast
Object to SqlInt32), so I explicity cast it:
Y = Ctype(dataset.tables("T")("X"), SqlInt32)
...but at runtime, the above Ctype throws an invalid cast exception.
I've tried all kinds of workarounds, but obviously I'm missing something
very basic... but what???
Thanks!
DT