Click here to Skip to main content
16,019,768 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying uploading excel file in my web application its showing error message as
E_FAIL(0x80004005), but if i debug the application in my local system data gets uploaded to the database .
i am using file upload control and button to upload data.
code is shown below
No error message available, result code: E_FAIL(0x80004005).
C#
//Reader to load content from Excel sheet
                   OleDbDataReader dReader;
                   excelConnection.Open();
                   dReader = cmdExcel.ExecuteReader();
                   SqlBulkCopy sqlBulk = new SqlBulkCopy(sqlcAdminConn);
                   //Give your Destination table name
                   sqlBulk.DestinationTableName = "admin.dbo.SwipeCardData";
                   sqlBulk.WriteToServer(dReader);
                   excelConnection.Close();
                   lblWarning.Text = "File Uploaded Successfully";
                   lblWarning.Visible = true
Posted
Updated 26-Jul-12 1:48am
v2
Comments
Sandeep Mewara 26-Jul-12 9:21am    
Not enough info to suggest on it. Check event logs.

1 solution

Actually, You need to write SqlTransaction for this operation when you commit data will definite store. Please provide full code, i this is small short of code. I can give you perfect solution for the same.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900