I am trying to read a csv file into an Oracle table using BulkCopy. I had done this with SQL and pretty straight forward, but with Oracle, once I get to the code
I get the error that
Table is not the expected format.
So not sure what's going on. I am reading an excel csv file using Office 2003. I did install the AccessDatabaseEngine. Not sure what else I need to do. Can someone look at the below code snippit and let me know what I am missing?
Dim excelCon As String
Dim conString As String = GetConnectionString()
'2007 & 2010 connection string
excelCon = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + txtFile.Text + ";Extended Properties=""Excel 12.0;HDR=NO;IMEX=1"""
Dim excelstrCon As New OleDb.OleDbConnection(excelCon)
'Create objects and get data
Dim cmd As New OleDb.OleDbCommand("SELECT [ID], [NAME], [ADDRESS], [CITY], [STATE], [ZIPCODE] FROM [sheet1$] ", excelstrCon)
Dim reader As OleDb.OleDbDataReader = cmd.ExecuteReader
'open the destination data
Dim dbCon As OracleConnection = New OracleConnection(conString)
Dim bulkCopy As OracleBulkCopy = New OracleBulkCopy(dbCon)
bulkCopy.DestinationTableName = "CUSTOMER_ADDRESS"
bulkCopy.BulkCopyTimeout = 500
Catch ex As Exception