Last post Aug 20, 2013 02:32 AM by Shawn - MSFT
Aug 19, 2013 02:03 AM|caulson|LINK
i had a problem when upload the row data in excel file,it show
i running the asp.net webpage in server 2003, is it i need to setting the permission in IIS ? kindly advise, thank you.
public partial class IMportData : System.Web.UI.Page
string strConnection = ConfigurationManager.ConnectionStrings["CIMProRPT01ConnectionString"].ConnectionString;
protected void Page_Load(object sender, EventArgs e)
string stat = Request.QueryString["stat"];
if (stat == "insert")
StatLabel.Text = "Row Data Import Completed";
protected void btnSend_Click(object sender, EventArgs e)
string path = fileuploadExcel.PostedFile.FileName;
//Create connection string to Excel work book
string excelConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + path + ";Extended Properties=Excel 12.0;Persist Security Info=False";
//Extended Properties=""Excel 8.0;HDR=YES;""";
//Create Connection to Excel work book
OleDbConnection excelConnection =
//Create OleDbCommand to fetch data from Excel
OleDbCommand cmd = new OleDbCommand
("Select [DATE],[REFNO],[LOCATOR],[SUBINV],[GRADE],[CARTONID],[QUANTITY],[BUYOFFDATE] from [Sheet1$]",
dReader = cmd.ExecuteReader();
SqlBulkCopy sqlBulk = new SqlBulkCopy(strConnection);
sqlBulk.DestinationTableName = "[WHMSExcelRowData].[dbo].[CARTONID_ROWDATA]";
Aug 19, 2013 02:05 AM|geniusvishal|LINK
Refer the link below:
Aug 19, 2013 02:06 AM|GiridharSai Chimata|LINK
hope this may help you
Aug 19, 2013 02:52 AM|caulson|LINK
i tried the step but it doesnt work, kindly advise, thank you
Aug 20, 2013 02:32 AM|Shawn - MSFT|LINK
This error can be caused by:
1. The file is still open on the machine or if it is on the network then someone still has it open.
2. If the file is on a network, then this has caused this error due to security settings and the advice is to move the file locally onto the server.
3. If the file is local then there are still permission issues that ares till present
If you have already ensured that the file is not open anywhere else and you have copied it locally to the server please see the below steps:
1. Ensure the file is saved locally on the server and is in a folder instead of being in the root folder.
2. Once the file is in a folder, go to the privileges of that folder and make sure the following users have full access of read and write: "network service" and "asp".
3. After granting these users access onto the folder and you still see the error, grant the user "Everyone" and test if this resolves the error.
For further information, you could refer to: