在客户端访问excel进行处理 [英] accessing excel at the client side for processing

查看:67
本文介绍了在客户端访问excel进行处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我创建了一个Web应用程序,该应用程序从客户端获取了三个excel文件,这些文件比较并处理了这些excel工作表,然后更新了相同的excel工作表.我曾经使用过ODBC提供程序.

在服务器上部署应用程序后,文件上传控件将获取excel文件的路径,并在服务器上查找它.

我只是想知道连接字符串可能有问题吗?就像在Sql Provider连接字符串中一样,我们使用DataSource属性指定服务器.

是否有任何属性可以对我为ODBC提供程序提供的连接字符串执行相同的操作?

请在这里帮助我,这是我在.net中的第一个项目

在此先感谢:)

Hi,

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 :)

推荐答案

如果您真的确定将excel作为后端.
尝试将其添加到app.config或web.config文件中的appconfig部分.
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];" />



例子



Example

<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"];



这样,您始终可以在不重建项目的情况下更改excel的路径.

并尝试变得更加足智多谋.使用Google.



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

and try to be more resourceful. use the google.


这篇关于在客户端访问excel进行处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆