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.
Ïà¹ØÎĵµ£º
<a>±êÇ©
1. <a href=”test.aspx”></a>
2. ÕâÊÇ×î³£¼ûµÄÒ»ÖÖתÏò·½·¨;
HyperLink¿Ø¼þ
1. Asp.net ·þÎñÆ÷¶Ë¿Ø¼þ ÊôÐÔNavigateUrlÖ¸¶ ......
¿ª·¢»·¾³:WIN XP VS2005
Êý¾Ý¿â:SQL server 2000
´Ë´¦²»¿¼ÂÇ°²È«ÎÊÌâ.
¾ßÌåÈçÏÂ:
Ê×ÏȽ¨Á¢Ò»¸öÊý¾Ý¿âºÍÒ»¸ö±í½á¹¹²¢ÔÚ±íÖÐÊäÈëһЩÊý¾ÝÒÔ±ã²âÊÔ:´Ë²½ÂÔ¹ý
´ò¿ªVS2005н¨Ò»¸öÍøÕ¾²¢Ìí¼ÓÒ»¸öHTMLÒ³
ÔÚĬÈϵÄDefault.aspxÖзÅÈëGridview¿Ø¼þÓÃÓÚÏÔʾÊý¾Ý
.cs´úÂë
using System;
using System.Data;
usi ......
ÍêÕû´úÂëÈçÏ£º02_ClientCentric.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="02_ClientCentric.aspx.cs" Inherits="ClientCentric" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="h ......