G
Guest
Hello,
I'm developing a APP that reads an Excel spreadsheet, does data
manipulation, and writes to a SQL Server table. I working with C#, Visual
Studio 2003, and Framework 1.1. When I connect to the Excel workbook I'm
using OLEDB.
The problem I'm have is with my In-line SQL having spaces in the Column
Headings. Here's a code snippet of my Sql:
string sqlCommand = "Select 'Invoice #','Invoice Date','Equipment
ID','Invoice Line Item Amount','Authorization #' " +
"From [InvoiceTemplate$]";
It is failing when I execute the sqlCommand because our vendors are sending
us Column headings with spaces and # signs. I created a dummy workbook with
normal column headings, and no spaces or special characters and I connected
fine.
Has anyone ran into this problem? If so, how did you handle it?
Thanks,
I'm developing a APP that reads an Excel spreadsheet, does data
manipulation, and writes to a SQL Server table. I working with C#, Visual
Studio 2003, and Framework 1.1. When I connect to the Excel workbook I'm
using OLEDB.
The problem I'm have is with my In-line SQL having spaces in the Column
Headings. Here's a code snippet of my Sql:
string sqlCommand = "Select 'Invoice #','Invoice Date','Equipment
ID','Invoice Line Item Amount','Authorization #' " +
"From [InvoiceTemplate$]";
It is failing when I execute the sqlCommand because our vendors are sending
us Column headings with spaces and # signs. I created a dummy workbook with
normal column headings, and no spaces or special characters and I connected
fine.
Has anyone ran into this problem? If so, how did you handle it?
Thanks,