I\'m importing data from an Excel sheet on to a DataTable using the following code:
OleDbConnection con = new OleDbConnection(\"Provider=Microso
How about filling the dataset programmatically instead of via a data adapter?
OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + fileName + ";Extended Properties=Excel 8.0");
Dim _myDataSet As New DataSet
Dim con As New OleDb.OleDbConnection
con.Open()
Dim cmd As New OleDb.OleDbCommand(" SELECT * FROM [" + "Sheet1" + "$]", con)
Using dr = cmd.ExecuteReader()
While dr.Read
Dim row = _myDataSet.Tables(0).NewRow()
With dr.Item("excel date column").ToString
Dim dt As New Date(CInt(.Substring(6)), CInt(.Substring(3, 2)), CInt(.Substring(0, 2)))
row.Item("dataset datecolumn") = dt
End With
\*'populate other columns here' *\
_myDataSet.Tables(0).Rows.Add(row)
End While
End Using