有没有办法在Excel Server中将excel表中的记录插入表中 [英] Is there any way to insert records from excel sheet to table in SQL Server

查看:77
本文介绍了有没有办法在Excel Server中将excel表中的记录插入表中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在Excel Server中将excel表中的记录插入到表中?

Is there any way to insert records from excel sheet to table in SQL Server

推荐答案

请参阅将数据导入SQL Server的简单方法

还有很多其他Just Google


没有编程方式,只需在sql server中使用IMPORT数据选项或以编程方式表示





DataSet ds = new DataSet();

String connString =Provider = Microsoft.ACE.OLEDB.12.0; +Data Source =+ FilePath +;扩展属性= Excel 12.0;;

objConn = new OleDbConnection(connString);

objConn.Open();

dt = objConn.GetOleDbSchemaTable(

OleDbSchemaGuid.Tables,new object [] {null,null,null,TABLE});



FilePath上传的Excel文件
Without Programmatically means, Just use IMPORT data option in sql server or programmatically means


DataSet ds = new DataSet();
String connString = "Provider=Microsoft.ACE.OLEDB.12.0;" + "Data Source=" + FilePath + ";Extended Properties=Excel 12.0;";
objConn = new OleDbConnection(connString);
objConn.Open();
dt = objConn.GetOleDbSchemaTable(
OleDbSchemaGuid.Tables, new object[] { null, null, null, "TABLE" });

FilePath is uploaded Excel file


你可以参考:



http://www.mikesknowledgebase.com/pages/SQLServer/ImportExcelIntoSQLServer.htm [ ^ ]


这篇关于有没有办法在Excel Server中将excel表中的记录插入表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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