在SQL数据库中导入exel [英] import exel in Sql Database

查看:80
本文介绍了在SQL数据库中导入exel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好...

我正在尝试将Exel工作表导入Sql table.如果我手动编写连接字符串,那么我可以工作.但是如果我使用fileuploader上传工作表,则我使用其他连接字符串.所以我会给出错误信息...
我的两个连接字符串都是..

hi everybody...

i am trying to import Exel sheet into Sql table.if i write the Connection string manually then i work.but if i use a fileuploader to upload the sheet then i use other connection string .so i''ll give an error...
my both connect strings are..

string path = Server.MapPath(fileuploadExcel.FileName);
 string excelConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + path + ";Extended Properties=""Excel 12.0Xml; HDR=YES""";


手动---


manually---

string excelConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Documents and Settings\Roopam Goenka\Desktop\Book1.xlsx;Extended Properties=""Excel 12.0 Xml;HDR=YES""";


请给我正确的连接字符串,以便我可以通过fileupload control


please give me correct connection string so that i can upload sheet by fileupload control

推荐答案

上载工作表在此处查找连接字符串: ^ ]
Look here for connection strings: Connection String[^]


这篇关于在SQL数据库中导入exel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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