Discussion:
如何讀取Excel中第一個工作表的資料
(时间太久无法回复)
ad
2006-05-07 21:39:54 UTC
Permalink
Excel €º©w²Ä€@­Ó€u§@ªíªºŠWºÙ¬°Sheet1
§Ú­Ì¥i¥H¥Î¥H€Uªºµ{Š¡œXŪšúsheet1€ºªºžê®Æ

string strConn = "Provider=Microsoft.Jet.Oledb.4.0;Data Source=" +
Server.MapPath("Book1.xls") + ";Extended Properties=Excel 8.0";
OleDbConnection conn = new OleDbConnection(strConn);
OleDbDataAdapter adp = new OleDbDataAdapter("Select * from [Sheet1$]",conn);
DataSet ds = new DataSet();
....

ŠýŠpªG²Ä€@­Ó€u§@ªíªºŠWºÙ¥ŒªŸ
ŠpŠóŪšú³o²Ä€@­Ó€u§@ªí€ºªºžê®Æ©O?
璉璉
2006-05-07 22:59:09 UTC
Permalink
§A¥i¥HžÕžÕ¬Ý¥Î GetOleDbSchemaTable¡G
http://support.microsoft.com/kb/318373/en-us
©ó news:uP%23YK7hcGHA.1320%40TK2MSFTNGP04.phx.gbl µoªí
§Ú­Ì¥i¥H¥Î¥H€Uªºµ{Š¡œXŪšúsheet1€ºªºžê®Æ
string strConn = "Provider=Microsoft.Jet.Oledb.4.0;Data Source=" +
Server.MapPath("Book1.xls") + ";Extended Properties=Excel 8.0";
OleDbConnection conn = new OleDbConnection(strConn);
OleDbDataAdapter adp = new OleDbDataAdapter("Select * from [Sheet1$]",conn);
DataSet ds = new DataSet();
.....
--
€ô®ü¬ì§Þšt²Î¬ãµoÅçÃÒ€u§@«Ç ASP.NET Web News Reader 0.2.0 UTF-8 Beta
·s»Džs²Õ RSSºô»xµo¥¬ŽúžÕ€€ http://tlcheng.no-ip.com/News/rss2.aspx
ºô¯žŠa¹Ï http://tlcheng.no-ip.com/wwwmap.htm
¬y°ìšŸ¬x/°Ï°ì€ôžê·œ/®}ª@ºô/ªŽºÀ¹Ï/»y­µ³q°T €å³¹»Pµ{Š¡
Basic/Fortran/Windows API/.Net/»²§U»¡©úÀÉ ­ì©lœX¡B€å³¹»P°Qœ×
--
ASPNET News http://tlcheng.no-ip.com/News/ | http://tlcheng.twbbs.org/News/
RSS 2.0 http://tlcheng.no-ip.com/News/rss2.aspx?Action=List&Newsgroup=microsoft.public.tw.dotnet.framework.aspnet
璉璉
2006-05-07 23:02:02 UTC
Permalink
.Net 2.0 ·sŒW GetSchema €]¥i¥HŠÒŒ{¡G
http://search.microsoft.com/results.aspx?mkt=en-US&setlang=en-US&q=GetSchema%20ADO
©ó news:001d01c67229%24d9709ee0%240a03a8c0%40tlcheng µoªí
§A¥i¥HžÕžÕ¬Ý¥Î GetOleDbSchemaTable¡G
http://support.microsoft.com/kb/318373/en-us
©ó news:uP%23YK7hcGHA.1320%40TK2MSFTNGP04.phx.gbl µoªí
§Ú­Ì¥i¥H¥Î¥H€Uªºµ{Š¡œXŪšúsheet1€ºªºžê®Æ
string strConn = "Provider=Microsoft.Jet.Oledb.4.0;Data Source=" +
Server.MapPath("Book1.xls") + ";Extended Properties=Excel 8.0";
OleDbConnection conn = new OleDbConnection(strConn);
OleDbDataAdapter adp = new OleDbDataAdapter("Select * from [Sheet1$]",conn);
DataSet ds = new DataSet();
.....
--
€ô®ü¬ì§Þšt²Î¬ãµoÅçÃÒ€u§@«Ç ASP.NET Web News Reader 0.2.0 UTF-8 Beta
·s»Džs²Õ RSSºô»xµo¥¬ŽúžÕ€€ http://tlcheng.no-ip.com/News/rss2.aspx
ºô¯žŠa¹Ï http://tlcheng.no-ip.com/wwwmap.htm
¬y°ìšŸ¬x/°Ï°ì€ôžê·œ/®}ª@ºô/ªŽºÀ¹Ï/»y­µ³q°T €å³¹»Pµ{Š¡
Basic/Fortran/Windows API/.Net/»²§U»¡©úÀÉ ­ì©lœX¡B€å³¹»P°Qœ×
--
ASPNET News http://tlcheng.no-ip.com/News/ | http://tlcheng.twbbs.org/News/
RSS 2.0 http://tlcheng.no-ip.com/News/rss2.aspx?Action=List&Newsgroup=microsoft.public.tw.dotnet.framework.aspnet
Loading...