Hi,
I am developing an excel import tool, where the user imports a set excel sheet and it populates it into the SQL database. Currently the structure is as follows:
User selects the Excel Sheet > gets uploaded and called upload.xls > is read through an access.mdb file using a linked table referring to a named reference called Data > shows it on web page (initial check) > imports it to a temp SQL Server Table > shows it on screen, showing only unique records (ones that aren't in the system) > data is imported.
It works perfectly well if the user imports the correct excel sheet, but if they don't it alerts the user with a nasty error (see below). Does anyone know how to trap this - and just goto another page?
If anyone could help me, I'd be grateful.
Regards,
Barnaby
The Microsoft Jet database engine cannot find the input table or query 'Data'. Make sure it exists and that its name is spelled correctly.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.OleDb.OleDbException: The Microsoft Jet database engine cannot find the input table or query 'Data'. Make sure it exists and that its name is spelled correctly.
Source Error:
Line 6577: this.Adapter.SelectCommand = this.CommandCollection[0];
Line 6578: DataSet_XLSImport.DataDataTable dataTable = new DataSet_XLSImport.DataDataTable();
Line 6579: this.Adapter.Fill(dataTable);
Line 6580: return dataTable;
Line 6581: } |