您的位置:首页 > 移动开发 > Objective-C

获取Excel中表的集合信息(framework2.0、1.1、1.0)

2007-04-24 17:17 369 查看
private void gettablelist(string dty){
   OleDbConnection oleConn = new OleDbConnection();
   oleConn.ConnectionString = "Provider=Microsoft.Jet.Oledb.4.0;data source="+dty+";Extended Properties=Excel 8.0;";
   oleConn.Open();
   DataTable dtOle = oleConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables,
    new object[] { null, null, null, "TABLE" }); 
   this.dg.DataSource=dtOle;
   this.dg.DataBind();
   dtOle = null;
   oleConn.Close();  

}

http://msdn2.microsoft.com/zh-cn/library/system.data.oledb.oledbconnection.getoledbschematable(VS.80).aspx
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息