Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ : asp.net

ASP.NetÈ«¾Ö±äÁ¿µÄÉèÖúͶÁÈ¡·½·¨

±¾ÎĽéÉÜÁ½ÖÖASP.NetÏîÄ¿ÖÐÈ«¾Ö±äÁ¿Ê¹Óõķ½Ê½¡£web.configÎļþ ºÍ GloabÎļþ¡£ÒÔÏ·ֱð˵Ã÷£º
·½·¨Ò»£ºweb.configÎļþ
——ÉèÖãº
ÔÚweb.configÎļþÀïÌí¼Ó¹Ø¼ü×ÖkeyÊÇͨ¹ý<appSettings>±ê¼ÇÀ´ÊµÏֵ쬵«ÊÇappSettings±ê¼Çͨ³£·ÅÔÚ<system.web>.....</system.web>±ê¼ÇÍâÃæ¡£Àý£º
<configration>
<appSettings>
<add key="connString1" value="server=localhost;user id=sa;pwd=;database=Êý¾Ý¿âÃû×Ö"/>
<add key="connString2" value="provider=Microsoft.Jet.OleDb.4.0;Data Source=Êý¾Ý¿â·¾¶"/>
</appSettings>
<system.web>
</system.web>
</configration>
——¶ÁÈ¡£º
ÒªÔÚ´úÂëÖÐÒýÓÃÕâЩÊý¾Ý¿âÁ¬½Ó×Ö·û´®£¬ÐèÒªÏÈÌí¼Ó¶ÔSystem.ConFigurationÃû×Ö¿Õ¼äµÄÒýÓã¬ÔÚÕâ¸öÃû×Ö¿Õ¼äÖк¬ÓÐConfigurationSettingsÀ࣬Æä¾²Ì¬·½·¨ConfigurationSettings.AppSettingsÊôÐÔ¿É»ñÈ¡web.configÎļþÖÐ<appSettings>½ÚµÄÉèÖ㬶Áµ½µÄֵΪstringÐÍ¡£ÀýÈ磺
using System.Configuration;
string conn1 = ConfigurationSettings.AppSettings["connString1"];
string ......

½«jQueryÓ¦ÓÃÓÚAsp.net Ajaxʱ£¬Ó¦±ÜÃâµÄ3¸ö´íÎó

3 mistakes to avoid when using jQuery with ASP.NET AJAX
AJAX, ASP.NET, JavaScript, jQuery By Dave Ward on June 5th, 2008
Over the past few weeks, I think I have definitely embodied Jeff Atwood’s claim that we’re all amateurs, learning together. Despite my best efforts to thoroughly test before posting, a few problems slipped through in my recent posts about using jQuery to consume ASP.NET JSON serialized web services and using jQuery to call ASP.NET AJAX page methods.
On the bright side, your great feedback in both posts’ comments has reinforced the fact that some of the best content on my blog is the part that you write.
In this post, I’m going to detail three of the problems that were discovered as a result of those previous two posts:
An extra requirement when making a read-only request to IIS6+.
An oddity in Internet Explorer 7’s XmlHttpRequest class.
A common mistake when passing JSON parameters through jQuery.
Finally, I’ll suggest w ......

½«jQueryÓ¦ÓÃÓÚAsp.net Ajaxʱ£¬Ó¦±ÜÃâµÄ3¸ö´íÎó

3 mistakes to avoid when using jQuery with ASP.NET AJAX
AJAX, ASP.NET, JavaScript, jQuery By Dave Ward on June 5th, 2008
Over the past few weeks, I think I have definitely embodied Jeff Atwood’s claim that we’re all amateurs, learning together. Despite my best efforts to thoroughly test before posting, a few problems slipped through in my recent posts about using jQuery to consume ASP.NET JSON serialized web services and using jQuery to call ASP.NET AJAX page methods.
On the bright side, your great feedback in both posts’ comments has reinforced the fact that some of the best content on my blog is the part that you write.
In this post, I’m going to detail three of the problems that were discovered as a result of those previous two posts:
An extra requirement when making a read-only request to IIS6+.
An oddity in Internet Explorer 7’s XmlHttpRequest class.
A common mistake when passing JSON parameters through jQuery.
Finally, I’ll suggest w ......

Asp.NetϵÄÎļþÉÏ´«¹¦ÄÜʵÏÖ

¸Õѧϰ.NetûÓж೤ʱ¼ä£¬ÒÔǰ¶¼ÊÇ¿´±ðÈ˵ÄÎÄÕ£¬Ñ§Ï°Ç°±²Ãǵľ­ÑéºÍ¼¼ÇÉ£¬×Ô¼ºÊÜÒæ·Ëdz¡£½ñÌìÒ²À´¸öÔ­´´µÄ£¬·¢¸öÎļþÉÏ´«µÄ´úÂë¡£Ö÷ҪʵÏֵŦÄÜÓУº1.¿ÉÒÔ¿ØÖÆÔÊÐíÉÏ´«µÄÎļþÀàÐÍ£»2.ÉÏ´«Ö®ºó×Ô¶¯ÒÔʱ¼äÃüÃû£»3.×Ô¶¯´´½¨ÉÏ´«ÎļþÒª±£´æµÄĿ¼¡£
²»×ãÖ®´¦£ºÃ»ÓжÔÔÊÐíÉÏ´«µÄÎļþ´óС×öÏÞÖÆ¡£ÆäËû²»×ãÖ®´¦»¹Íû¸÷λָ³ö£¬ÒÔ±ã¸Ä½ø¡£µÚÒ»´Î·¢ÎÄÕ£¬ÏÊ»¨¡¢×©Í·×Ô¼º×¼±¸£¡ºÇºÇ~~~
ÒªÒýÈëÃüÃû¿Õ¼ä System.IO;
#region ÉÏ´«Îļþ
    protected void btn_upload_Click(object sender, EventArgs e)
    {
        bool fileOK = false;
        //ÎļþµÄÉÏ´«Â·¾¶
        string path = Server.MapPath("~/UpLoadFiles/Files/");
        //ÅжÏÉÏ´«Îļþ¼ÐÊÇ·ñ´æÔÚ£¬Èô²»´æÔÚ£¬Ôò´´½¨
        if (!Directory.Exists(path))
        {
            //´´½ ......

asp.net·Àsql×¢Èë

 using (con)
        {
            con.Open();
            String sqltext = "select * from emp where empno=@empno";
            SqlCommand cmd = new SqlCommand(sqltext, con);
            cmd.Parameters.AddWithValue("@empno", this.TextBox.Text);
           
            GridView1.DataSource = cmd.ExecuteReader();
            GridView1.DataBind();
        }
¼´Ê¹ÓòÎÊý»¯£¬¶ø²»ÊÇÖ±½ÓÆ´½ÓsqlÓï¾ä£¬¼òµ¥ÓÐЧ£¬ÄÜ»ù±¾Ó¦¶ÔÍøÕ¾µÄÒ»°ã°²È«ÒªÇó¡£µ«ÊÇÿ¸ösqlÓï¾äÓÖÒª²ÎÊý»¯£¬¶ÔÓÚ²ÎÊý±È½Ï¶àµÄÓï¾äдÆðÀ´±È½ÏÂé·³¡£ ......

asp.net·Àsql×¢Èë

 using (con)
        {
            con.Open();
            String sqltext = "select * from emp where empno=@empno";
            SqlCommand cmd = new SqlCommand(sqltext, con);
            cmd.Parameters.AddWithValue("@empno", this.TextBox.Text);
           
            GridView1.DataSource = cmd.ExecuteReader();
            GridView1.DataBind();
        }
¼´Ê¹ÓòÎÊý»¯£¬¶ø²»ÊÇÖ±½ÓÆ´½ÓsqlÓï¾ä£¬¼òµ¥ÓÐЧ£¬ÄÜ»ù±¾Ó¦¶ÔÍøÕ¾µÄÒ»°ã°²È«ÒªÇó¡£µ«ÊÇÿ¸ösqlÓï¾äÓÖÒª²ÎÊý»¯£¬¶ÔÓÚ²ÎÊý±È½Ï¶àµÄÓï¾äдÆðÀ´±È½ÏÂé·³¡£ ......

asp.net µ¼³öExcel·½·¨»ã×Ü

µÚÒ»ÖÖ£ºÐèÒªÒýÓÃcom £ºmicrosoft.excel.11.0.
//Éú³ÉExcelÎļþµÄ´úÂë
protected void ExportExcel()
{
Microsoft.Office.Interop.Excel.Application excel = new Microsoft.Office.Interop.Excel.Application();
Microsoft.Office.Interop.Excel.Workbook wb = excel.Workbooks.Add(Microsoft.Office.Interop.Excel.XlWBATemplate.xlWBATWorksheet); // ´´½¨¹¤×÷²¾
Microsoft.Office.Interop.Excel.Worksheet ws = (Microsoft.Office.Interop.Excel.Worksheet)wb.Worksheets[1]; // ´´½¨¹¤×÷Ò³
DataSet ds = GetData();
int iMaxRow = ds.Tables["rsData"].Rows.Count;
int iMaxCol = ds.Tables["rsData"].Columns.Count;
// ÉèÖøñʽ
ws.get_Range(ws.Cells[1, 1], ws.Cells[1, iMaxCol]).Font.Name = "ºÚÌå";
ws.get_Range(ws.Cells[1, 1], ws.Cells[1, iMaxCol]).Font.Bold = true;
ws.get_Range(ws.Cells[1, 1], ws.Cells[iMaxRow + 1, iMaxCol]).Borders.LineStyle = 1;
......

ÔÚASP.NETÖжÁдExcelÎļþÓÐËÄÖÖ½â¾ö·½°¸¡£

ÔÚASP.NETÓ¦ÓóÌÐò³£³£»áÓöµ½ÐèÒª´ÓExcelÎļþÖжÁÈ¡Êý¾Ý»ò½«Êý¾ÝдÈëExcelµÄÐèÇó¡£Ò»°ãÀ´½²£¬ÔÚASP.NETÖжÁдExcelÎļþÓÐËÄÖÖ½â¾ö·½°¸¡£
1.1.1 ʹÓÃOLE DB
ʹÓÃOLE DB¿ÉÒÔÒÔ²éѯÊý¾Ý¿âµÄ·½Ê½À´¶ÁÈ¡ExcelÎļþ£¬ÒòΪÔÚijÖ̶ֳÈÉÏExcel±í¸ñ¿ÉÒÔ¿´³ÉÊÇÒ»ÕÅÒ»ÕŵÄÊý¾Ý±í¡£Æä¶þÕßµÄÖ÷񻂿±ðÔÚÓÚËùʹÓõÄÊý¾ÝÒýÇæ²»Ò»Ñù¡£Ê¹ÓÃOLE DB·ÃÎÊExcelµÄÒªµãÊǼÆËã»úÉϱØÐë¾ßÓÐMicrosoft Access Data Component 2.6(MADC2.6)ÒÔÉϰ汾£¬Í¬Ê±ÔÚÁ¬½Ó×Ö·û´®ÉϱØÐëÉùÃ÷“Extended Properties=Excel 8.0”£¬ÕâÀïµÄÖ¸¶¨Excel °æ±¾ºÅÈç¹û¸ßÓÚ8.0¿ÉÄÜ»á³ö´í£¬ËùÒÔÒ»°ãÀ´½²±ØÐëʹÓÃExcel 8.0¡£
È»ºóÆäËüµÄд·¨¾ÍºÍÒ»°ãµÄ·ÃÎÊÊý¾Ý¿âÒ»ÑùÁË£¬´ò¿ªÁ¬½Ó£¬Ìî³äÊý¾Ý¼¯£¬ÔٹرÕÁ¬½Ó¼´¿É¡£ÀýÈçÏÂÃæµÄʵÏÖ´úÂ룺
//´´½¨Ò»¸öÊý¾ÝÁ´½Ó
string strCon = " Provider = Microsoft.Jet.OLEDB.4.0 ; Data Source = c:\\sample.xls;Extended Properties=Excel 8.0" ;
OleDbConnection myConn = new OleDbConnection ( strCon ) ;
string strCom = " SELECT * from [Sheet1$] " ;
myConn.Open ( ) ;
//´ò¿ªÊý¾ÝÁ´½Ó£¬µÃµ½Ò»¸öÊý¾Ý¼¯
OleDbDataAdapter myCommand = new OleDbDataAd ......
×ܼǼÊý:2672; ×ÜÒ³Êý:446; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [261] [262] [263] [264] 265 [266] [267] [268] [269] [270]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ