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
How to start / run a stored procedure from a Winform by clicking a button
Access multi-column combobox selection
Vista-Win 2003 Trust Relationship Issue
trouble with Access buttons
how do I change the default name in a comment box in Excel 2007?
Problem Opening Access 2000 Front-End with Access 2003.
sql to copy data from table 1 to table 2 in sep databases
validating parameters in batch file
Internet Explorer screen goes black - Veeeeery mysterious problem!
How to use /AUXSOURCE= flag to retrieve descriptions of errors in Event viewer