views:

50

answers:

2

Hello All,

I'm getting an invalid cast exception but I'm not sure why, here is the list of my conversions.

SQL -> VB.NET

char(4) -> String

varchar(50) -> String

tinyint -> Integer

char(1) -> Char

bit -> boolean

smallint -> Integer

smallmoney -> Double

int -> Integer

datetime -> datetime

Thanks in advance for your help

+1  A: 

It's possible that smallmoney should go to Decimal instead... but why not just use a binary chop to try the first half, then the second etc to narrow down what's causing the problem?

If you could post the query involved, that would help too.

Jon Skeet
You are right, I came across this http://msdn.microsoft.com/en-us/library/bb386947.aspx which really helped me out. Also, the following were correct conversions that I had messed up, smallint -> Int16 and tinyint -> byte.
Russell Durham
A: 

smallmoney maps to Decimal, see msdn (numeric mapping)

Femaref