ASP.Net 2.0 Excel app requires MS Office on webserver

S

SoAzAppDever

I am using asp.net 2.0. I have an application that gets data from an excel
spreadsheet and displays it in a datagrid. It works as it should. However,
when I deploy this application to the webserver I am required to install MS
Office. I do not want to install MS Office on the web server is there an
alternative method that does not require MS Office to be installed on the web
server?

Below is my code:

string excelConnStr = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" +
path + @"; Extended Properties = ""Excel 12.0 Xml; HDR=YES; IMEX=1;""";
OleDbConnection excelConn = new OleDbConnection(excelConnStr);
OleDbCommand excelCommand = new OleDbCommand();
OleDbDataAdapter excelDataAdapter = new OleDbDataAdapter();
DataSet ds = new DataSet();


System.Data.DataTable dtEmployees = new System.Data.DataTable();
excelCommand = new OleDbCommand("SELECT first, last, begindate,
endate FROM [employees$]", excelConn);
excelDataAdapter.SelectCommand = excelCommand;

excelDataAdapter.Fill(dtEmployeeLeave);

dtEmployees.TableName = "ImportEmps";
ds.Tables.Add(dtEmployees);
 
B

Bob Barrows

SoAzAppDever said:
I am using asp.net 2.0.

There was no way for you to know it (except maybe by browsing through some
of the previous questions in this newsgroup before posting yours - always a
recommended practice) , but this is a classic (COM-based) asp newsgroup.
ASP.Net bears very little resemblance to classic ASP so, while you may be
lucky enough to find a dotnet-knowledgeable person here who can answer your
question, you can eliminate the luck factor by posting your question to a
group where those dotnet-knowledgeable people hang out. I suggest
microsoft.public.dotnet.framework.aspnet or the forums at www.asp.net.
I have an application that gets data from an
excel spreadsheet and displays it in a datagrid. It works as it
should. However, when I deploy this application to the webserver I
am required to install MS Office. I do not want to install MS Office
on the web server is there an alternative method that does not
require MS Office to be installed on the web server?

Below is my code:

string excelConnStr = "Provider=Microsoft.ACE.OLEDB.12.0; Data
Source=" + path + @"; Extended Properties = ""Excel 12.0 Xml;
HDR=YES; IMEX=1;"""; OleDbConnection excelConn = new
OleDbConnection(excelConnStr); OleDbCommand excelCommand = new
OleDbCommand(); OleDbDataAdapter excelDataAdapter = new
OleDbDataAdapter(); DataSet ds = new DataSet();
I see nothing here that requires the installation of MS Office. What made
you think Office needed to be installed?

The web server might not have the ACE provider, but that's an MDAC upgrade,
not an Office installation..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top