我想将excel文件数据导入数据库......通过asp.net,c#..... [英] I want to import excel file data into database... through asp.net,c#.....

查看:37
本文介绍了我想将excel文件数据导入数据库......通过asp.net,c#.....的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将excel文件数据导入数据库...

到asp.net,c#.....



请帮助我....

解决方案

为什么不使用SSIS(SQL Server Integration Services)将数据导入数据库?这是最快的方法。如果你想使用asp.net,你可以使用OleDbConnection访问Excel表格。



 OleDbConnection oconn = new OleDbConnection(@ Provider = Microsoft.Jet.OLEDB.4.0; Data Source =+ Server.MapPath(example.xls)+;扩展属性= Excel 8.0); 





您可以通过指定工作表名称来访问数据。

 OleDbCommand ocmd = new OleDbCommand(select * from [Sheet1 

,oconn);


I want to import excel file data into data base...
through asp.net,c#.....

please help me....

解决方案

Why don't you use SSIS (SQL Server Integration Services) to import the data into your database ? That is the fastest way to do it. If you want to do it using asp.net you can use the OleDbConnection to access the Excel sheet.

OleDbConnection oconn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("example.xls") + ";Extended Properties=Excel 8.0");



You can access the data by specifying the sheet name.

OleDbCommand ocmd = new OleDbCommand("select * from [Sheet1


", oconn);


这篇关于我想将excel文件数据导入数据库......通过asp.net,c#.....的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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