The following code works in one project but not another:
Dim fl As String = Server.MapPath("parser.xls")
If File.Exists(fl) Then
File.Delete(fl)
End If
fileUpload.PostedFile.SaveAs(fl)
Dim strConn As String
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & fl & ";Extended Properties=Excel 8.0;"
Dim myCommand As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter("SELECT * FROM [Sheet1$]", strConn)
Dim dt As DataTable = New DataTable
myCommand.Fill(dt)
NOTE: The error I get is "Unspecified Error" (really helpful). It occurs on the last line above. The file IS being saved, it has "Sheet1", and "Sheet1" has data.
Thanks in advance.
Dim fl As String = Server.MapPath("parser.xls")
If File.Exists(fl) Then
File.Delete(fl)
End If
fileUpload.PostedFile.SaveAs(fl)
Dim strConn As String
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & fl & ";Extended Properties=Excel 8.0;"
Dim myCommand As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter("SELECT * FROM [Sheet1$]", strConn)
Dim dt As DataTable = New DataTable
myCommand.Fill(dt)
NOTE: The error I get is "Unspecified Error" (really helpful). It occurs on the last line above. The file IS being saved, it has "Sheet1", and "Sheet1" has data.
Thanks in advance.