将Excelsheet数据保存到sqlserver [英] Save excelsheet data into sqlserver

查看:112
本文介绍了将Excelsheet数据保存到sqlserver的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有问题..我是开发领域中的新手.我的问题是..我有excel文件..我以工作表的形式从工作表返回数据..我想将此数据保存到数据库中.但是我无法做到这一点..pls帮助我..i无法将数据从Microsoft.ACE.OLEDB.12.0映射到数据库..i在这里也使用了"sqlbulk",但仍然没有得到想要的结果.列的名称不同..不是列的名称..pls帮助我..


i have problem..i am new in development field.my problem is..i have excel file..where i return data from sheet as a DataTable..i want to save this data into database.but i am unable to do it..pls help me..i am not able to map data from Microsoft.ACE.OLEDB.12.0 to database..i used here "sqlbulk" also but still not getting the desied result..no. of column are different..not the name of the columns..pls help me out..

推荐答案

有关将excel数据转换为datatable的信息,请参见:
http://www.aspspider.com/resources/Resource510.aspx [
for converting excel data to datatable refer:
http://www.aspspider.com/resources/Resource510.aspx[^]

and you can fill this datatable to database using DataAdapter object
as:


您应该已经在网上搜索过,请选中这些

使用类型化的数据集和TableAdapter导入Excel电子表格:构建数据库 [使用SqlBulkCopy-ASP.NET将Excel数据导出到Sql Server中 [ ^ ]

您可以在Google中找到更多
Atleast you should have searched in web, Check these

Importing an Excel Spreadsheet Using Typed DataSets and TableAdapters: Building the Database[^]
Export Import Excel Data into Sql Server Using SqlBulkCopy-ASP.NET[^]

you can find more in Google


这篇关于将Excelsheet数据保存到sqlserver的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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