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

有没有办法在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 [ ^ ]