如何将数据从Excel存储到asp.net中的数据库 [英] how to store data from excel to database in asp.net

查看:56
本文介绍了如何将数据从Excel存储到asp.net中的数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将数据从excel存储到数据库中,但它给出了以下我将给出的消息.我还启用了SQL Server 2008中的临时配置

有人告诉我
在此先感谢

链接服务器(null)"的OLE DB访问接口"Microsoft.Jet.OLEDB.4.0"返回消息未指定错误".
消息7303,第16级,状态1,第1行
无法为链接服务器(null)"初始化OLE DB访问接口提供程序"Microsoft.Jet.OLEDB.4.0"的数据源对象.



我已在查询窗口中使用此代码

i want to store data from excel to database but it give this msg which is i given below. i have also enable ad hoc configuration in sql server 2008

any one tell me
thanks in advance

OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" returned message "Unspecified error".
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".



i have using this code in query window

INSERT INTO tb_Excel (ID,Name,Location)
SELECT ID,Name,Location
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
                'Excel 8.0;Database=F:\Details.xls',
                'SELECT * FROM [Sheet1$]')

推荐答案

')


签出:

将数据从Excel导入到SQL Server [将数据从Excel或使用TSQL脚本从Access导入到SQL Server [
check this out:

Import Data from Excel to SQL Server[^]

Import Data to SQL Server from Excel or Access using TSQL Script[^]

hope it helps :)


修复链接

[无法为链接服务器初始化OLE DB提供程序Microsoft.Jet.OLEDB.4.0的数据源对象 [无法初始化OLE DB提供程序的数据源对象链接服务器(null)"的"microsoft.jet.oledb.4.0" [链接服务器错误 [从中导出数据不使用SSIS或DTS的SQL Server到Excel [
Fix links

OLE DB provider "MICROSOFT.JET.OLEDB.4.0" for linked server "(null)" returned message "Unspecified error"[^]
Cannot initialize the data source object of OLE DB provider Microsoft.Jet.OLEDB.4.0 for linked server[^]
Cannot initialize the data source object of OLE DB provider "microsoft.jet.oledb.4.0" for linked server "(null)"[^](There is a workaround)
Linked Server Error[^]

Export data from SQL Server to Excel without using SSIS or DTS[^]


这篇关于如何将数据从Excel存储到asp.net中的数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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