View Complete Post
I am trying to simply extract an excel data from an uploaded file an put it into a datatable. In this case the excel file has 3 rows but when I fill the datatable I only see row count of 2.
I tried changing HDR:NO; to HDR:YES and vice versa, but no luck.
What am I doing wrong? (Note: the excel file cannot have a headerrow)
string connstr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + pFilePath + ";Extended Properties=\"Excel 12.0;IMEX=1;HDR:NO;\"";
OleDbConnection conn = new OleDbConnection(connstr);
DataTable dtTables = conn.GetOleDbSchemaTable(System.Data.OleDb.OleDbSchemaGuid.Tables, null);
string strTablename = dtTables.Rows["TABLE_NAME"].ToString();
string strSQL = "SELECT * FROM [" + strTablename + "]";
OleDbCommand cmd = new OleDbCommand(strSQL, conn);
DataTable dt = new DataTable();
OleDbDataAdapter da = new OleDbDataAdapter(cmd);
//At this point row count=2 which doesn't make sense
I want to develop an application which supports Server Side Excel Automation using a template(xltx). I am able to acheive most of the automation except(using excelpackage.dll - OfficeOpenXml), i am stuck up identifying the checkbox controls in my excel work sheet.
Any help on this is really appreciated.
My sample code.
I am using .net version 1.1 and excel 2003 to display data.I need to display data in 2007 .Can anyone suggest the reference to be added ,connection string change and what should be imported.
I'm trying to import (Custom Lists >> Import Spreadsheet) into WSS 3.0 and I'm getting the following message:
Refers to the _layouts
You are not authorized to view this page. You might not have permissions to view this direcotyr or page using the credentials you supplied. [More stuff here.]
Http ERror 403 - Forbidden
Is this just a permissions problem or is there some other underlying issue? Should you be able to upload an Excel spreadsheet (with links) into a Custom List?
we receive error while trying to create excel sheet using the template we have uploaded on the SharePoint 2007.
This occurs on a machine that has Office 2010 installed. Earlier the machine had Office 2007 and everything was working fine.
Can you let me know why is problem is coming and how to resolve this.
Does Sharepoint 2007 Server support the new Excel 2010 feaures like slicers? Or do i have to have Sharepoint 2010 to get that working (considering all other components besides Sharepoint 2010 are available in my Sharepoint 2007 environment) ?
I'm tried SELECT * INTO XXX FROM OPENROWSET alongwith Microsoft.ACE.OLEDB.12.0.
Apparently the query requires the sql account to have SYSADMIN privileges.
Considering that SYSADMIN should not be provided to a database account on a Production Server, I tried using the Linked Server method.
Following is my code.
Exec sp_addlinkedserver 'AB2','Ace 12.0','Microsoft.ACE.OLEDB.12.0','\\18.104.22.168\sagarr\Test1\cpc\c2\AB2.xlsx',NULL,'Excel 12.0;IMEX=1'Exec sp_addlinkedsrvlogin 'AB2','false',NULL,NULL,NULLgoSELECT * INTO [CPCAB2.xlsx] FROM OPENQUERY([AB2] ,'SELECT * FROM [Sheet1$]')Exec sp_dropserver 'AB2','droplogins'
Now i get the following error
Error.15247-User does not have permission to perform this action
My Excel file, Database and Windows Application run on separate machines.
i have provided the following privileges
GRANT ALTER ANY LOGIN TO sqlaccountGRANT ALTER ANY LINKED SERVER TO sqlaccountEXEC sp_configure 'show advanced options', 1RECONFIGUREEXEC sp_configure 'ad hoc distributed queries', 1RECONFIGUREThe DisAllowAdHocProcess in