Microsoft
Software
Hardware
Network
Question : Converting an Access Date/Time column's value to a DateTime object
My program is throginw an exception on this line:
DateTime time = reader.GetDateTime(date_ti
me_sentInd
ex);
But I do not understand why? It's a C# program trying to read that value from an Access database.
Here's the exception:
Specified cast is not valid. line:606 stracktrace: at System.Data.OleDb.ColumnBi
nding.Valu
eDateTime(
)
I have verified the column number is valid, and do not know what I'm doing wrong.
Could someone please help?
newbieweb
Answer : Converting an Access Date/Time column's value to a DateTime object
Try
DateTime time = Convert.ToDateTime(reader.
GetDateTim
e(date_tim
e_sentInde
x));
HTH
Ashok
Random Solutions
replace field value with another value using MS TSQL
SystemDB and MDW questions
Table parameter in SQL 2008
OSC 2007 R2, need to deploy a FQDN pool. not sure how to
After Update event code
MS Access 2007 Passthrough Query Fails
SBS 2008/Exchange 2007 broken Autodiscover
Can't reach <a rel="nofollow" href="http://localhost" target="_blank">http://localhost</a>
Can you recover a lost Administrator password?
Sever Cert always invalid