首页 > 数据库技术 > 详细

oledb快速导入Excel案例

时间:2014-03-24 16:14:08      阅读:474      评论:0      收藏:0      [点我收藏+]

DataTable dtImportExcel = null;
string pathFile = Server.MapPath("~/ErrorCatory.xlsx");
//string strConn = @"Provider=Microsoft.Ace.OleDb.12.0;" + "data source=" + UploadFilePath + ";Extended Properties=‘Excel 12.0; HDR=Yes; IMEX=1;‘";
//strConn = string.Format(strConn, UploadFilePath);
//OleDbConnection connExcel = new OleDbConnection(strConn);
//// where [紧急程度] is not null
//string commandText = string.Format("SELECT * FROM [2013.01$] where [紧急程度] is not null ");
//try
//{
// dtImportExcel = new DataTable("ImportCheck");
// OleDbDataAdapter daImportExcel = new OleDbDataAdapter(commandText, connExcel);
// daImportExcel.Fill(dtImportExcel);
//}
//catch (Exception ex)
//{

//}
//finally
//{

//}

oledb快速导入Excel案例,布布扣,bubuko.com

oledb快速导入Excel案例

原文:http://www.cnblogs.com/guozefeng/p/3620513.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!