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
Does SingleOrDefault return null on multiple results?
Visual Studio 2008 C# call external program
Reference for Accessing Minitab Objects via VBA
Copy Excel and Paste Special into Outlook E-mail Message Body
Run Excell 2007 via C++
cursor position in textbox
Automation error in Vista CreateObject("InternetExpl<wbr />orer.appli<wbr />cation")
How do I print a list of AutoComplete sites and the usernames/passwords
this exchange activesync server requires security features your phone does not support on Droid
Repeat Header Columns on each page of the Report..