上传excel文件时出现未指定的错误 [英] unspecified error while upload the excel file

查看:690
本文介绍了上传excel文件时出现未指定的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在上传excel文件时,

while uploadiing the excel file ,

System.Data.OleDb.OleDbException: Unspecified errorat System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection) at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.OleDb.OleDbConnection.Open() at clsOledbClass.opencon()

推荐答案

您的connectionstring不正确。检查用于读取excel文件的连接字符串。



发送用于上传execl文件的代码。
Your connectionstring is not correct. Check the connectionstring used to read excel file.

Send the code used to upload execl file.





解决方案:



这个问题可以通过把< identity impersonate =false/>来解决。在配置文件中。





描述:



Wehn .net读取excel文件,它创建一个临时文件夹来存储数据,该临时文件夹只能由ASPNET帐户访问。因此,如果您冒充计算机/网络上的另一个用户并尝试使用ASPNET读取excel文件中的数据,您将无法进行。
Hi,

Solution:

This issue can be solved by putting <identity impersonate="false"/> in Configuration file.


Description:

Wehn .net reads an excel file, it creats a temp folder to store the data, and that temp folder can only be access by the ASPNET account. so if you impersonate as another user on the computer / network and tried to use ASPNET to read the data in the excel file, you will not be able to.


你的连接字符串是错误的是两个连接字符串xls和xlsx在线检查,
ur connection string is wrong there is two connection string for xls and xlsx check online,


这篇关于上传excel文件时出现未指定的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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