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
Edot form data
Microsoft, Access, 2007, Prevent exclusive locking of linked table
How do I update a subform combobox from another form that the subform called?
Update Code through VBA
Restrict Formatting & Editing, Start Enforcement Option not Available
add ALL in combobox rowsource query
Attach Text Box and Combo Box text
Squid on Windows 2003
Missing Comma Error.....?
Cannot load TPSMain.exe as CpuPerf.dll not found