Ken,
I forgot to mention the database is a MySql database which does not seem to
like .net 2.0, the ODBC connector I believe is buggy. However, before the
weeks up I may convert it all to SQL Server, which I'm researching now.
From the samples I've looked at (assuming field "Portfolio_Number" is an
Int16) --- Int16 iValue = (Int16) dr["Portfolio_Number"]; --- would be the
correct way for retrieving the value. Actually that's a question.
Thanks,
"Ken" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> Jim Stools wrote:
>> The field was actually an Int32 however the number is always positive and
>> will never be over 2,000. The variable storing the number is Int16 so I
>> ended up using
>>
>> Int16 iValue = (Int16) (Int32) dr["Portfolio_Number"];
>>
>> which seems to work.
>
> Jim, I just looked at your code again. With your cast, you are trying
> to cast the Object, not its value! (Don't worry, I have done that many
> times myself! :-)
>
> I am not sure what your castings will do, but I don't know if this will
> return what you want.
>
> Ken - KC7RAD
> www.aninetworks.com
>