asp.net Excelµ¼Èë&µ¼³ö
1¡¢ExcelÊý¾Ýµ¼Èëµ½Êý¾Ý¿âÖУº
//¸Ã·½·¨ÊµÏÖ´ÓExcelÖе¼³öÊý¾Ýµ½DataSetÖУ¬ÆäÖÐfilepathΪExcelÎļþµÄ¾ø¶Ô·¾¶£¬sheetnameΪ±íʾÄǸöExcel±í£»
public DataSet ExcelDataSource( string filepath , string sheetname )
...{
string strConn;
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + filepath + ";Extended Properties=Excel 8.0;";
OleDbConnection conn = new OleDbConnection(strConn);
OleDbDataAdapter oada = new OleDbDataAdapter ( "select * from [" + sheetname + "$]", strConn );
DataSet ds = new DataSet ();
oada.Fill ( ds );
return ds ;
}
ÉÏÃæµÄ´úÂëʵÏÖÁ˽«ExcelÖеÄÊý¾Ýд½øDataSetÖУ¬ÊµÏÖÁËÕâÒ»²½ºó£¬Äã¿ÉÒÔ°´ÕÕ×Ô¼ºµÄÐèÒª¶Ô»ñµÃDataSet½øÐд¦Àí£¬ÐèҪעÒâµÄÒ»¸öÎÊÌâÊÇ£¬Äã±ØÐëÒªÖ¸¶¨sheetname£¬¼´ExcelÖеÄÄÄÒ»¸ö¹¤×÷µ¥ÐèÒªµ¼È룬·ñÔò»á³öÏÖ´íÎó¡£
2¡¢ÈçºÎ´ÓExcelÖлñµÃ¹¤×÷µ¥£¨sheetname£©£º
//»ñµÃExcelÖеÄËùÓÐsheetname¡£
public ArrayList ExcelSheetName ( string filepath )
...{
ArrayList al = new ArrayList ();
string strConn;
strConn = "Provider=Microsoft.Jet.
Ïà¹ØÎĵµ£º
תÔØ×Ô¡¾ÃÏ×ÓEÕ¡¿£ºhttp://blog.csdn.net/net_lover/archive/2007/08/27/1760521.aspx
¾³£ÓÐÈËÓöµ½ASP.NET 2.0£¨ASP.NET 1.xÖпÉÄÜÊÇÓÐЧµÄ£©ÖÐCSSʧЧµÄÎÊÌ⣬ÏÖ½«Ö÷ÒªÔÒòºÍ½â¾ö·½·¨ÂÞÁÐÈçÏ£º
1.CSSÎļþ·¾¶²»ÕýÈ·
Õâ¸öÎÊÌâÊôÓÚWeb¿ª·¢ÖеĻù´¡ÎÊÌ⣬һ°ã²ÉÓÃÏà¶Ô·¾¶»á³öÏÖÕâÑùµÄÎÊÌ⣬»òÕßÑùÊ ......
<a>±êÇ©
1. <a href=”test.aspx”></a>
2. ÕâÊÇ×î³£¼ûµÄÒ»ÖÖתÏò·½·¨;
HyperLink¿Ø¼þ
1. Asp.net ·þÎñÆ÷¶Ë¿Ø¼þ ÊôÐÔNavigateUrlÖ¸¶ ......
£¼input id = " loFile " type = " file " runat = " server " £¾
£¼form method = " post " enctype =" multipart/form-data " runat = " server "£¾
£¼/form £¾
1.»ñµÃÉÏ´«ÎļþµÄÃû³Æ£º£¨¹Ø¼üÊÇPostedFileÀàµÄÓ¦Óã©
ʹÓÃPathÀàÖеÄGetFileName·½·¨£¬¾ßÌåÈçÏ£º
lstrFileName = loFile.PostedFile.FileName
......
----------------------ModalPopupExtender
D:\sourceforge\asp.net\AjaxControlToolkit_net20\SampleWebSite\ModalPopup\ModalPopup.aspx
// linkbutton1Ôö¼ÓÀ©Õ¹ModalPopupExtenderÊôÐÔ:
<asp:LinkButton ID="LinkButton1" runat="server" Text="Click here to change the paragraph styl ......