Hi,
I am using fileupload contrl to upload an xlsx file and read it in datatable
filepath = Server.MapPath(fileUploadExcel.FileName);
connString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + filepath + "; Extended Properties=Excel 12.0";
the above code gives me the connection string as below
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\A.B\Documents\Visual Studio 2015\Projects\Test.SharePoint.Tools\Test.SharePoint.ToolsWeb
\Sheet.xlsx; Extended Properties=Excel 12.0
I want the connection string as below:
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\A.B\Desktop\sheet.xlsx; Extended Properties=Excel 12.0
what wrong i am doing or is there any way to get the path in the way i want.
It basically is taking path from the location where my control is and not from the actual location.
any suggestions?