Hi,
The data types in SQL & .NET do not usually match , you can use
Convert.ToInt16().
tinyint is defined in SQL as a 8 bit data, therefore GetInt16() give you
error, you should use GetByte() instead.
Cheers,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
<an*******@discussions.microsoft.com> wrote in message
news:19*****************************@phx.gbl...
Hi all
My datareader reads a tinyint SQL column. How do I
retrieve the value of the column.
SqlDr.GetInt16(MyTinyIntColumnOrdinal) fails and causes a
InvalidCastException. Thanks for your help.