T
tshad
I have a dataset with a date in it. The type is smalldatetime on Sql Server
and I am just doing a "SELECT * from x" to get it.
All my other fields are fine, but this one gives me an error of:
Specified cast is not valid.
The data that is coming back is:
2005-05-09 17:52:59.923
My C# line is:
dateCreated = (string)user["DateCreated"];
I also tried:
dateCreated = (DateTime)user["DateCreated"];
How am I supposed to set this to get a date that I haven't converted to a
VarChar?
Thanks,
Tom
and I am just doing a "SELECT * from x" to get it.
All my other fields are fine, but this one gives me an error of:
Specified cast is not valid.
The data that is coming back is:
2005-05-09 17:52:59.923
My C# line is:
dateCreated = (string)user["DateCreated"];
I also tried:
dateCreated = (DateTime)user["DateCreated"];
How am I supposed to set this to get a date that I haven't converted to a
VarChar?
Thanks,
Tom