vs2008ÖÐasp.netµÄwebÓ¦ÓóÌÐò¸ÄwebÍøÕ¾
vs2008ÖÐн¨b/s½á¹¹µÄÏîÄ¿ÓÐÁ½ÖÖÀàÐÍ£¬Ò»ÖÖÊÇweb application,¼´webÓ¦ÓóÌÐò£¬ÁíÍâÒ»ÖÖÊÇwebÍøÕ¾£¬Ð½¨ÏîĿʱÈç¹ûÑ¡ÔñµÄ²»ÕýÈ·£¬ÔÚºóÐøµÄ¿ª·¢¹ý³ÌÖоͲ»¿É±ÜÃâµÄ»áÓöµ½ÒªÐÞ¸ÄÏîÄ¿ÀàÐ͵ÄÇé¿ö¡£¾¹ýÔÚÍøÉϱ¬×ßÒÔ¼°²âÊÔ£¬ÒÔÏÂÊǽâ¾öasp.netÓ¦ÓóÌÐò¸ÄÍøÕ¾ÏîÄ¿µÄ·½·¨¼°±³¾°ÖªÊ¶£º
1.vs2008µÄÏîÄ¿ÀàÐÍÊÇͨ¹ýguidÀ´È·¶¨µÄ
ÔÚ½â¾ö·½°¸ÎļþÖÐ(.sln)£¬ÓüÇʱ¾´ò¿ª¿´µÄ»°¿ÉÒÔ¿´µ½Project("ºóÃæ¸úµÄÊÇguidÖµ£¬ÍøÕ¾ÀàÏîÄ¿µÄguidºÍÓ¦ÓóÌÐòÀàÏîÄ¿µÄguidÖµÊDz»Ò»ÑùµÄ£¬ÎÒÃÇ¿ÉÒÔËæ±ãн¨Ò»¸öÍøÕ¾£¬È»ºó°Ñproject("ºóÃæµÄguidÖµ¸´ÖƳöÀ´±¸Óá£
Èç¹ûÄãµÄ½â¾ö·½°¸ÎļþÖеÄÖµÊÇProject("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"),ÄÇôÕâ¾ÍÊÇÒ»¸öÓ¦ÓóÌÐòÀàÐ͵ÄÏîÄ¿£¬ÍøÕ¾ÀàÏîÄ¿µÄÖµÓ¦¸ÃÊÇ£ºProject("{E24C65DC-7377-472B-9ABA-BC803B73C61A}")£¬ÎÒÃÇÒª×öµÄ¾ÍÊÇÒª°ÑÏîÄ¿ÀàÐ͸ijÉÕâ¸öÍøÕ¾µÄguidÖµ¡£
2.ÍøÕ¾ÀàÏîÄ¿±Èasp.netÓ¦ÓóÌÐòÏîÄ¿¶à³öÀ´Ò»Ð©²ÎÊýÖµ
ÍøÕ¾ÀàÏîÄ¿ÔÚ½â¾ö·½°¸ÎļþÖжà³öÀ´Ò»Ð©ÐéÄâ·¾¶ÒÔ¼°±àÒë·½ÃæµÄ²ÎÊýÐÅÏ¢£¬Ó¦ÓóÌÐòÀàÏîĿûÓÐÕâЩÄÚÈÝ£¬ËùÒÔÎÒÃÇ»¹ÊÇҪн¨Ò»¸ö¿ÕµÄÍøÕ¾ÏîÄ¿£¬½«ÒÔÏÂÄÚÈݸ´ÖƵ½ÔÀ´µÄÓ¦ÓóÌÐòÏîÄ¿µÄ²ÎÊýÏ£º
ProjectSection(WebsiteProperties) = preProject
TargetFramework = "3.5"
Debug.AspNetCompiler.VirtualPath = "/WebSite1" ----------------------->ÕâÀïÐèÒª¸Ä
Debug.AspNetCompiler.PhysicalPath = ".\XinRong_Steel_Tube\" ----------------------->ÕâÀïÐèÒª¸Ä
Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\WebSite1\" ----------------------->ÕâÀïÐèÒª¸Ä
Debug.AspNetCompiler.Updateable = "true"
Debug.AspNetCompiler.ForceOverwrite = "true"
Debug.AspNetCompiler.FixedNames = "false"
Debug.AspNetCompiler.Debug = "True"
Release.AspNetCompiler.VirtualPath = "/WebSite1" &nbs
Ïà¹ØÎĵµ£º
ÌõÐÎÂëÊÇÆù½ñΪֹ×á¢ÊµÓõÄÒ»ÖÖ×Ô¶¯Ê¶±ð¼¼Êõ¡£ÌõÐÎÂë¼¼Êõ¾ßÓÐÒÔϼ¸¸ö·½ÃæµÄÓŵã
¡¡¡¡A£®ÊäÈëËٶȿ죺Óë¼üÅÌÊäÈëÏà±È£¬ÌõÐÎÂëÊäÈëµÄËÙ¶ÈÊǼüÅÌÊäÈëµÄ5±¶£¬²¢ÇÒÄÜʵÏÖ“¼´Ê±Êý¾ÝÊäÈ딡£
¡¡¡¡B£®¿É¿¿ÐԸߣº¼üÅÌÊäÈëÊý¾Ý³ö´íÂÊΪÈý°Ù·ÖÖ®Ò»£¬ÀûÓùâѧ×Ö·ûʶ±ð¼¼Êõ³ö´íÂÊΪÍò·ÖÖ®Ò»£¬¶ø²ÉÓÃÌõÐÎÂë¼¼ÊõÎóÂëÂʵ ......
ËäȻ˵ASP.NETÊôÓÚ°²È«ÐԸߵĽű¾ÓïÑÔ,µ«ÊÇÒ²¾³£¿´µ½ASP.NETÍøÕ¾ÓÉÓÚ¹ýÂ˲»ÑÏÔì³É×¢Éä.ÓÉÓÚASP.NET»ù±¾ÉÏÅäºÏMMSQLÊý¾Ý¿â¼ÜÉè Èç¹ûȨÏÞ¹ý´óµÄ»°ºÜÈÝÒ×±»¹¥»÷. ÔÙÕßÔÚÍøÂçÉÏÕÒ²»µ½ºÃµÄASP.NET·À×¢Éä½Å±¾,ËùÒÔ¾Í×Ô¼ºÐ´Á˸ö. ÔÚÕâÀï¹²Ïí³öÀ´Ö¼ÔÚÈóÌÐòÔ±Ãâ³ýSQL×¢ÈëµÄÀ§ÈÅ.
ÎÒдÁËÁ½¸ö°æ±¾,VB.NETºÍC#°æ±¾·½±ã²»Í¬³ÌÐò¼äʹÓà ......
ÎÒÃÇ»¹¿ÉÒÔ²ÉÓÃÒ»ÖÖ¸ü¼Ó¼ò±ãµÄ·½
·¨À´ÊµÏÖÉÏÊö³ÌÐòµÄ¹¦ÄÜ¡£Õâ¾ÍÊǽ«SqlConnection¶ÔÏó°üº¬µ½usingÇø¿éÖУ¬ÕâÑù³ÌÐò»á×Ô¶¯µ÷ÓÃDispose()·½·¨ÊÍ·Å
SqlConnection¶ÔÏóËùÕ¼ÓõÄϵͳ×ÊÔ´£¬ÎÞÐèÔÙʹÓÃSqlConnection¶ÔÏóµÄClose()·½·¨¡£
·¶Àý³ÌÐò´úÂëÈçÏ£º
public partial class _Default : System.Web.UI.Page
{
......
¸ÅÄÆäʵ˼··Ç³£¼òµ¥£¬¾ÍÏñ»»Ò»Ñù£¬ÄãÄÔÖеıýͼÏëɶÑù×ӵģ¬¾Í°ÑËüÔÚÍøÒ³ÀﻳöÀ´¶øÒÑ¡£ÏàÐÅ´ó¼ÒСʱºò¶¼»¹ý»£¬²»Í¬µÄÊÇ£¬Ð¡Ê±ºò£¬ÔÚÖ½ÉÏ»£¬ÏÖÔÚÔÚÍøÒ³ÉÏ»¡£
ÕâÊÇÎÒÄÔ×ÓÀï±ýͼµÄÑù×Ó£º<¼¤¹â´«Õæ»ú>
C#ºǫ́ʾÀý´úÂ룺<¼¤¹âÒ»Ìå»ú>
using System;
using System.Data;
using System.Configur ......
ƪһ£º»ù´¡Ó¦ÓÃ
×ÊÔ´Îļþͨ³£±»ÓÃÔÚ¶àÓïÑÔ°æ±¾µÄ²úÆ·ºÍÏîÄ¿µ±ÖУ¬Í¨¹ý¼òµ¥µÄÉèÖúÍÒýÓü´¿ÉʵÏÖ²»Í¬ÓïÑÔµÄת±ä£¬Ï൱µÄ·½±ã¡£ÔÚ.NetÖÐÒ»°ã¿ÉÒÔ°üÀ¨×Ö·û´®¡¢Í¼Ïñ¡¢Í¼±ê¡¢ÒôƵ¡¢Îı¾ÎļþµÈ£¬ÓÐÏ൱һ²¿·ÖÈ˺͹«Ë¾ÔÚ¿ª·¢µÄ¹ý³ÌÖж¼°ÑÕâЩ×ÊÔ´·ÅÖÃÔÚרÃŵÄÎļþ¼ÐÖУ¨ÎÒºÍÎÒĿǰµÄ¹«Ë¾Ò²Èç´Ë£©£¬Í¨¹ýÏà¶Ô·¾¶¼ÓÒÔÒýÓã¬Ò²ºÜ·½±ã ......