Click here to Skip to main content
15,946,342 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:

I have created an web application which takes three excel files from the client side which compares and processes those excel sheets and then updates the same excel sheet. I have used ODBC provider.

After deploying the application over a server the file upload control takes the path of the excel files and looks for it on the server.

I was just wondering could it be a problem with the connection string? Like in Sql Provider connection string we use the DataSource attribute to specify the server.

Is there any attribute that will do the same for the connection string I have for ODBC provider?

Please help me out here, this is my very first project in .net

Thanks in advance :)
Updated 16-Mar-11 7:20am
Dylan Morley 16-Mar-11 12:30pm    
Edit for readability
Sergey Alexandrovich Kryukov 16-Mar-11 13:12pm    
Ha-ha-ha! Excel as a database... most popular database as one publications said. What a waste!
Sorry for you.
fjdiewornncalwe 16-Mar-11 22:40pm    
Seriously Mohamed, you really have to consider that the architecture of this solution is simply never going to be a good idea this way. Working with Access is even a better idea. As a highly experienced developer I would much rather stick my hand in a pool full of jelly fish than work with this setup.
MohamedHassanAli 17-Mar-11 3:30am    
I know working on excel is such a pain Marcus and SA. But still thing are a little bit fine now. Somehow its working. I couldnt deploy it at a server instead deployed it in the user machine itself. Thank you all :)

1 solution

If you are really sure about the excel as your backend.
Try this to add into your appconfig section in app.config or web.config file.
<add key="ExcelConnectionString" value="OLEDB;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=[Your excel file path here];" />

<add key="ExcelConnectionString" value="OLEDB;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\excel.xls;" />

in your code behind add this
string constr = ConfigurationManager.Appsettings["ExcelConnectionString"];

this way you can always change the path of the excel without rebuilding your project.

and try to be more resourceful. use the google.
Share this answer
Dalek Dave 17-Mar-11 4:34am    
MohamedHassanAli 17-Mar-11 8:09am    
Micha3ldg ! Thanks for the response. I have already done my homework. I have already used the connection string more or less similar to the one u have provided. My question was something else.
MohamedHassanAli 17-Mar-11 8:10am    
Thank you all for the help. I got the solution for the problem.
Micha3ldg 17-Mar-11 12:47pm    
you're welcome

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