打开Excel文件时出现错误 [英] Having Error Whle Opening Excel File

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

问题描述

我正在尝试从excel工作表中获取列名.但是,我遇到了此错误.

尝试为文件C:\ Documents and Settings \ Administrator \ My Documents \ Visual Studio 2008 \ Projects \ Web Application 10 \ Web Application 10 \ App_Data \ vinoth.xls附加自动命名的数据库失败.存在具有相同名称的数据库,或者无法打开指定的文件,或者该数据库位于UNC共享上.

1.我已经关闭了连接并关闭了所有东西.但是仍然我遇到了这个错误.请指导我.

I am trying to get the column name from excel sheet.But , I am getting this error.

An attempt to attach an auto-named database for file C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\Web Application 10\Web Application 10\App_Data\vinoth.xls failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

1.I have Closed the connection and closed everything.But Still i an getting this error. Please guide me.

推荐答案

尝试添加
User Instance=True;

到您的连接字符串-可能会解决问题.

To your connection string - it may sort the problem.


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

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