I need to be able to have a user upload an excel file, then immediately work with that file and save the contents in a database.
I know how to do this if I save the file first, then open it using OleDB, BUT I would rather not save it first. Any help or guidance would be greatly appreciated.
OleDb/ODBC is about the only way to extract data from an Excel sheet. Since the provider has to have a file path provided for its Data Source property, you must save the file.
I am using a FileUpload control to allow users to select the file they want to upload. Then I get data directly from Excel file (without saving the Excel file) using OLEDB and save it in my Sql Server DB.
1. This works fine when I am working locally or I am logged in to the server that hosts this Excel UPload/Save application.
2. This does not work when I am accessing the Application outside the server using URL. I get the error :
The Microsoft Jet database engine could not find the object 'Sheet1$'. Make sure the object exists and that you spell its name and the path name correctly.
So, I am planning to upload the file on to the server first and then try to get the data out of it.
lzoumas
Member
28 Points
54 Posts
Upload and Import Excel file into database WITHOUT Saving First
Apr 13, 2010 09:29 PM|LINK
I need to be able to have a user upload an excel file, then immediately work with that file and save the contents in a database.
I know how to do this if I save the file first, then open it using OleDB, BUT I would rather not save it first. Any help or guidance would be greatly appreciated.
Thanks in advance,
Lee
Mikesdotnett...
All-Star
155597 Points
19981 Posts
Moderator
MVP
Re: Upload and Import Excel file into database WITHOUT Saving First
Apr 14, 2010 04:29 AM|LINK
OleDb/ODBC is about the only way to extract data from an Excel sheet. Since the provider has to have a file path provided for its Data Source property, you must save the file.
Web Pages CMS | My Site | Twitter
manjunatht
Member
84 Points
44 Posts
Re: Upload and Import Excel file into database WITHOUT Saving First
Apr 15, 2010 09:41 AM|LINK
Excel sheet as to be saved first, to get the data
SSG10
Member
2 Points
2 Posts
Re: Upload and Import Excel file into database WITHOUT Saving First
Apr 22, 2010 04:37 AM|LINK
I am using a FileUpload control to allow users to select the file they want to upload. Then I get data directly from Excel file (without saving the Excel file) using OLEDB and save it in my Sql Server DB.
1. This works fine when I am working locally or I am logged in to the server that hosts this Excel UPload/Save application.
2. This does not work when I am accessing the Application outside the server using URL. I get the error : The Microsoft Jet database engine could not find the object 'Sheet1$'. Make sure the object exists and that you spell its name and the path name correctly.
So, I am planning to upload the file on to the server first and then try to get the data out of it.