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
combining sql
What is the Best Way to Setup Microsoft Access Record Navigation?
ADO connecting to access database - no named arguments
How to force Outlook to save contacts into public contacts folder??
What is datatype #9?
LINQ Query not yielding expected results
How can I get the windows version from a dos prompt
How to sort complecated text in excel
SBS2003 Server Mail store recovery
Where can i find a list of differences between IIS 7.0 and IIS 7.5