I have a vb.net web site that uploads a .xls file, selects a few columns, and inserts the data into sql server 2008R2. When I run the web site I get this error on OleDataAdapter fill:
ArgumentException was unhandled by user code
The DateTime represented by the string is not supported in calendar System.Globalization.GregorianCalendar.Couldn't store <0000-00-00T00:00 > in Starting Date & Time Column. Expected type is DateTime.
Two columns have datetime values. The values in these columns are formated such as 2013-02-05T12:48
Not quite sure why I am getting the above error. Here is the code below:
Protected Sub btnUpload_Click(sender As Object, e As System.EventArgs) Handles btnUpload.Click
If (txtFilePath.HasFile) Then
Dim conn As OleDbConnection
Dim cmd As OleDbCommand
Dim da As OleDbDataAdapter
Dim dt As DataTable
...
Go to the complete details ...