For example:
if(dbReader["WSFilingStatus"] != DBNull.Value) wsFilingStatus =
(SqlMoney)dbReader["WSFilingStatus"];
This gives me an error that SqlMoney is not a valid type. But in some of
the docs it says this is the one to use. I can't seem to make it work so I
changed it to:
if(dbReader["WSFilingStatus"] != DBNull.Value) wsFilingStatus =
(decimal)dbReader["WSFilingStatus"];
But not sure if this is the best way or not.
Thanks,
Tom
Casting to decimal is fine. However, SqlMoney does exist in the
System.Data.SqlTypes namespace.
--
Dave Sexton
http://davesexton.com/blog
"tshad" <tschei...@ftsolutions.com> wrote in message
news:uMJNVeFM...@TK2MSFTNGP03.phx.gbl...
Then do I need to add a new Using statement? Because I am getting an error
if I specify it.
I already have:
using System;
using System.Data;
using System.IO;
using System.Data.SqlClient;
Thanks,
Tom
Yes, you need a new using statement. SqlMoney isn't defined in SqlClient,
it's defined in SqlTypes.
Regardless, decimal is fine unless you require the ability to check for
DBNull, but since you've already hard-coded a check for DBNull, using
SqlMoney would be redundant.
--
Dave Sexton
http://davesexton.com/blog
"tshad" <tschei...@ftsolutions.com> wrote in message
news:u3ynA%23GMHH...@TK2MSFTNGP03.phx.gbl...
Technically, it's a using directive that you need, not a using statement :)
--
Dave Sexton
http://davesexton.com/blog
"Dave Sexton" <dave@jwa[remove.this]online.com> wrote in message
news:OWpFwMHM...@TK2MSFTNGP04.phx.gbl...