Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ASP.netÁ¬½ÓExcel

Ê×ÏÈÌí¼ÓÃüÃû¿Õ¼ä
using System.Data.OleDb;
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
strfile = Request.QueryString["filename"];//´ÓÆäËûÒ³Ãæ´«¹ýÀ´µÄÎļþ·¾¶
Excel(strfile);
}
}

private void Excel(string filepath)
{
try
{
Dataset ds = new DataSet();
string ConnStr = "Provider=Microsoft.Jet.OleDb.4.0;data source=" + filepath +
";Extended Properties='Excel 8.0; HDR=YES; IMEX=1'";//Á¬½ÓExcelµÄ×Ö·û´®
string query = "SELECT * from [student$]";//ExcelÖеıíÃû³Æ
OleDbCommand oleCommand = new OleDbCommand(query, new OleDbConnection(ConnStr));
OleDbDataAdapter oleAdapter = new OleDbDataAdapter(oleCommand);
oleAdapter.Fill(ds, "[student$]");
rowcount = ds.Tables[0].Rows.Count;
gridview1.DataSource = ds;
gridview1.DataBind();
lblmes.Text = "ÉÏ´«³É¹¦£¬Êý¾ÝÈçÏÂËùʾ£¬ÇëÈ·ÈÏ£º";//lblmesΪlabel£¬ÏÔʾÌáʾÐÅÏ¢
}
catch (OleDbException)
{
string filename = filepath.Substring(filepath.LastIndexOf('/') + 1);
lblmes.Text = "´íÎó£¡ÇëÈ·ÈÏÉÏ´«ÎļþÊÇ·ñÕýÈ·£¡µ±Ç°ÉÏ´«µÄÎļþΪ£º" + filename;
lbtnSure.Visible = false;
}
catch(Exception ee)
{
lblmes.Text = ee.Message;
}
}


Ïà¹ØÎĵµ£º

ASP.NET´ò¿ªÐÂÒ³Ãæ¶ø²»¹Ø±ÕÔ­À´µÄÒ³Ãæ

ASP.NET´ò¿ªÐÂÒ³Ãæ¶ø²»¹Ø±ÕÔ­À´µÄÒ³Ãæ
Respose.Write("<script     language='javascript'>window.open('"+     url     +"');</script>"); £¨´ò¿ª¼ò½à´°¿Ú£©£º
Respose.Write("<script     l ......

ASP.net Gridview ʹÓÃÖ¸ÄÏ

GridViewʹÓÃÏê½â
 01 GridViewÎÞ´úÂë·ÖÒ³ÅÅÐò
 02 GridViewÑ¡ÖУ¬±à¼­£¬È¡Ïû£¬É¾³ý
 03 GridViewÕý·´Ë«ÏòÅÅÐò
 04 GridViewºÍÏÂÀ­²Ëµ¥DropDownList½áºÏ
05 GridViewºÍCheckBox½áºÏ
 06 Êó±êÒÆµ½GridViewijһÐÐʱ¸Ä±ä¸ÃÐеı³¾°É«·½·¨Ò»
 07 Êó±êÒÆµ½GridViewijһÐÐʱ¸Ä±ä¸ÃÐеı³¾° ......

Asp.NET»ñÈ¡Îļþ¼°Æä·¾¶


¡¾Ïà¶Ô·¾¶¡¿
Request.ApplicationPath
/src
Path.GetDirectoryName(HttpContext.Current.Request.RawUrl )
\\src\\Xiaoshe
Context.Request.Path
/src/Xiaoshe/Xiaoshe_New.aspx
Context.Request.CurrentExecutionFilePath
/src/Xiaoshe/Xiaoshe_New.aspx
Context.Request.FilePath
/src/Xiaoshe/Xiaoshe ......

asp.netÀûÓÃjqueryµÄajax·½·¨À´ÑéÖ¤µÇ½µÄ´úÂë

Ðí¶à³ÌÐòÔ±ÔÚ×öÒµÎñ¿ª·¢Ê±ÍùÍù»áÔÚ·þÎñÆ÷¶Ë×öÓû§ÐÅÏ¢µÄÑéÖ¤£¬ÓÐûÓп¼ÂǹýÓÃjqueryµÄajax·½·¨À´ÑéÖ¤µÇÂ½ÄØ£¿ÇÒЧ¹û±ÈÔÚ·þÎñÆ÷¶Ëд´úÂëÀ´ÑéÖ¤ºÃµÄ¶à£¬Ò³ÃæÎÞˢм´¿ÉʵÏÖʵÏֵǽÑéÖ¤£¬´úÂëÒ²¼òµ¥¡£
ÏÖÔÚÏÂÃæÌù³öÀ´µÄÊǺܼòµ¥µÄÓÃjqueryµÄajax·½·¨À´ÑéÖ¤µÇ½µÄ´úÂ룬ÊʺϸսӴ¥jqueryµÄÅóÓÑѧϰ¡£
Ç°Ì¨Ò³Ãæ´úÂ룺
<he ......

ÈçºÎÔÚ ASP.NET ÍøÒ³ÖÐʵÏֻص÷

ÈçºÎ£ºÔÚ ASP.NET ÍøÒ³ÖÐʵÏֻص÷
ÔÚ¿Í»§¶Ë»Øµ÷ÖУ¬¿Í»§¶Ë½Å±¾º¯Êý»áÏò ASP.NET ÍøÒ³·¢ËÍÇëÇ󣬸ÃÍøÒ³Ëæºó»áÔËÐÐÆäÕý³£ÉúÃüÖÜÆÚµÄ¼ò»¯°æ±¾ÒÔ´¦Àí¸Ã»Øµ÷¡£ÈôҪȷ±£»Øµ÷ʼþÔ´ÓÚÔ¤ÆÚµÄÓû§½çÃæ (UI)£¬¿ÉÒԶԻص÷½øÐÐÑéÖ¤¡£Ôڻص÷ÑéÖ¤ÖУ¬Ó¦ÏÈÔÚÍøÒ³³ÊÏÖ¹ý³ÌÖÐ×¢²áÒªÑéÖ¤µÄʼþ£¬È»ºóÔڻص÷¹ý³ÌÖжԸÃʼþ½øÐÐÑéÖ¤¡£Óйػص÷µ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ