Re: DataReader values and .ToString by William
William
Tue Jul 24 10:51:19 CDT 2007
To avoid spending a lot of time coding, I send all of my DataReader output
to a DataTable via the Load method.
This deals with a litany of issues--one of which you describe here...
--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant, Dad, Grandpa
Microsoft MVP
INETA Speaker
www.betav.com
www.betav.com/blog/billva
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------
"Michel Vanderbeke" <michel.vanderbeke@skynet.be> wrote in message
news:46a614b6$0$13858$ba620e4c@news.skynet.be...
> Hello,
>
> In order to avoid errors, I have all my DataReader-fields converted with a
> .ToString.
> This in case some record could have Null-fields and an error would be
> thrown.
>
> This works fine, except for "money" fields in SQL-Server.
> When I enter e.g. ? 2,50 and I read it back with a DataReader without
> .ToString, I get the correct display.
> However using .ToString, I get no valuta-sign and the value is multiplied
> by 10 000.
>
> When trying to StringFormat the DataReader.ToString, I get a syntax error.
>
> Can someone explain this to me an offer some help?
>
> Many thanks and greetings,
>
> Michel
>
>