SmallDateTime

  • Thread starter Thread starter Jim Heavey
  • Start date Start date
J

Jim Heavey

If you are creating an DataTable and pulling your data from a Sql2000 DB
and you have a column which is defined as SmallDateTime, what datatype to I
map this to when I am building a DataTable? I mapped it to DateTime, and I
am guessing that this is what is causing a Schema error when I attempt to
load it. So is it my datatype or should I be looking for something else?

Thanks in advance for your assistance!!!!!
 
SmallDateTime should map fine to DateTime. The only potential caveat I can
think of is when your database is set to one date format and your app server
to another. Try casting out the SmallDateTime as a string and then casting
into the DateTime structure. If this works, you have identified the spot of
failure.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

**********************************************************************
Think Outside the Box!
**********************************************************************
 
Jim,

The .NET DateTime field can not handle nulls. Test what you're doing on a
subset of data that happens to have no nulls and see if you get the same
error. Nulls are a pain, but you can deal with them if you need to. They
simply aren't worth the trouble if dbnull and "" (or 0/dbnull) are equvilent
in your domain. Dates are often the issue.

Kathleen
 
Back
Top