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

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Óï¾äÓÖÒª²ÎÊý»¯£¬¶ÔÓÚ²ÎÊý±È½Ï¶àµÄÓï¾äдÆðÀ´±È½ÏÂé·³¡£


Ïà¹ØÎĵµ£º

º½¿Õ¹«Ë¾¹ÜÀíϵͳ(VC++ ÓëSQL 2005)

ϵͳ»·¾³£ºWindows 7
Èí¼þ»·¾³£ºVisual C++ 2008 SP1 +SQL Server 2005
±¾´ÎÄ¿µÄ£º±àдһ¸öº½¿Õ¹ÜÀíϵͳ
      ÕâÊÇÊý¾Ý¿â¿Î³ÌÉè¼ÆµÄ³É¹û£¬ËäÈ»³É¼¨²»¼Ñ£¬µ«ÊÇ×÷ΪÎÒÓÃVC++ ÒÔÀ´±àдµÄ×î´ó³ÌÐò»¹ÊÇ´«µ½ÍøÉÏ£¬ÒÔ¹©²Î¿¼¡£ÓÃVC++ ×öÊý¾Ý¿âÉè¼Æ²¢²»ÈÝÒ×£¬µ«Ò²²»ÊDz»¿ÉÄÜ¡£ÒÔÏÂÊÇÎҵijÌÐò½çÃæ£¬ºóÃæ ......

SQL INTERSECTµÄÓ÷¨

ºÍ UNION Ö¸ÁîÀàËÆ£¬ INTERSECT Ò²ÊǶÔÁ½¸ö SQL Óï¾äËù²úÉúµÄ½á¹û×ö´¦ÀíµÄ¡£²»Í¬µÄµØ·½ÊÇ£¬ UNION »ù±¾ÉÏÊÇÒ»¸ö OR (Èç¹ûÕâ¸öÖµ´æÔÚÓÚµÚÒ»¾ä»òÊǵڶþ¾ä£¬Ëü¾Í»á±»Ñ¡³ö)£¬¶ø INTERSECT Ôò±È½ÏÏñ AND ( Õâ¸öÖµÒª´æÔÚÓÚµÚÒ»¾äºÍµÚ¶þ¾ä²Å»á±»Ñ¡³ö)¡£ UNION ÊÇÁª¼¯£¬¶ø INTERSECT Êǽ»¼¯¡£
INTERSECT µÄÓï·¨ÈçÏ£º
[SQLÓï¾ä ......

SQL SUBSTRINGµÄÓ÷¨

SQL ÖÐµÄ substring º¯ÊýÊÇÓÃÀ´×¥³öÒ»¸öÀ¸Î»×ÊÁÏÖÐµÄÆäÖÐÒ»²¿·Ö¡£Õâ¸öº¯ÊýµÄÃû³ÆÔÚ²»Í¬µÄ×ÊÁÏ¿âÖв»ÍêȫһÑù£º
MySQL: SUBSTR(), SUBSTRING()
Oracle: SUBSTR()
SQL Server: SUBSTRING()
×î³£Óõ½µÄ·½Ê½ÈçÏ (ÔÚÕâÀïÎÒÃÇÓÃSUBSTR()ΪÀý)£º
SUBSTR(str,pos): ÓÉ<str>ÖУ¬Ñ¡³öËùÓдӵÚ<pos>λÖÿªÊ¼µÄ× ......

SQL INSERT INTOµÄÓ÷¨

µ½Ä¿Ç°ÎªÖ¹£¬ÎÒÃÇѧµ½Á˽«ÈçºÎ°Ñ×ÊÁÏÓɱí¸ñÖÐÈ¡³ö¡£µ«ÊÇÕâЩ×ÊÁÏÊÇÈç¹û½øÈëÕâЩ±í¸ñµÄÄØ£¿ Õâ¾ÍÊÇÕâÒ»Ò³ (INSERT INTO) ºÍÏÂÒ»Ò³ (UPDATE) ÒªÌÖÂ۵ġ£
»ù±¾ÉÏ£¬ÎÒÃÇÓÐÁ½ÖÖ×÷·¨¿ÉÒÔ½«×ÊÁÏÊäÈë±í¸ñÖÐÄÚ¡£Ò»ÖÖÊÇÒ»´ÎÊäÈëÒ»±Ê£¬ÁíÒ»ÖÖÊÇÒ»´ÎÊäÈëºÃ¼¸±Ê¡£ ÎÒÃÇÏÈÀ´¿´Ò»´ÎÊäÈëÒ»±ÊµÄ·½Ê½¡£
ÒÀÕÕ¹ßÀý£¬ÎÒÃÇÏȽéÉÜÓï·¨¡£Ò»´ÎÊäÈ ......

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

±¾ÎĽéÉÜÁ½ÖÖASP.NetÏîÄ¿ÖÐÈ«¾Ö±äÁ¿Ê¹Óõķ½Ê½¡£web.configÎļþ ºÍ GloabÎļþ¡£ÒÔÏ·ֱð˵Ã÷£º
·½·¨Ò»£ºweb.configÎļþ
——ÉèÖãº
ÔÚweb.configÎļþÀïÌí¼Ó¹Ø¼ü×ÖkeyÊÇͨ¹ý<appSettings>±ê¼ÇÀ´ÊµÏֵ쬵«ÊÇappSettings±ê¼Çͨ³£·ÅÔÚ<system.web>.....</system.web>±ê¼ÇÍâÃæ¡£Àý£º
<conf ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ