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
format two column page
JQuery is disabled by partial postbacks
Broken Reference to the file dao2535.tlb error message on opening Access Data Base created in Access 97
Direct Push not receiving unread emails
SBS 2008 Upgrade from W2003 Domain
Trying to open Outlook 2000 PST in Outlook 2003
where parameters aspx .net page
How do you Clone a Custom List Item
Excel VBA Enum and String
LINQ to SQL insertonsubmit, multiple instances before submitchanges