Asp.net ÊÂÎñ´¦Àí
ÊÂÎñ´¦ÀíÊÇÔÚÊý¾Ý´¦Àíʱ¾³£Óöµ½µÄÎÊÌ⣬¾³£Óõ½µÄ·½·¨ÓÐÒÔÏÂ3ÖÖ×ܽáÕûÀíÈçÏ£º ·½·¨1£ºÖ±½ÓдÈëµ½sql ÖÐ ÔÚ´æ´¢¹ý³ÌÖÐʹÓà BEGIN TRANS, COMMIT TRANS, ROLLBACK TRANS ʵÏÖ Óŵ㣺ÊÂÎñÂß¼°üº¬ÔÚÒ»¸öµ¥¶ÀµÄµ÷ÓÃÖУ¬ÓÐÔËÐÐÒ»¸öÊÂÎñµÄ×î¼ÑÐÔÄÜ£¬Á¢ÓÚÓ¦ÓóÌÐò¡£ÏÞÖÆ£º ÊÂÎñÉÏÏÂÎĽö´æÔÚÓÚÊý¾Ý¿âµ÷ÓÃÖУ¬Êý¾Ý¿â´úÂëÓëÊý¾Ý¿âϵͳÓйء£
·½·¨2 £ºÊ¹ÓÃADO.NET ʵÏÖ
ʹÓÃADO.NET ʵÏÖ£¬Ê¹ÓÃÕâÖÖ·½Ê½µÄÓŵãÊÇ¿ÉÒÔÔÚÖмä²ãÀ´¹ÜÀíÊÂÎñ£¬µ±È»ÄãÒ²¿ÉÒÔÑ¡ÔñÔÚÊý¾Ý²ãÀ´ÊµÏÖ¡£ SqlConnection ºÍOleDbConnection ¶ÔÏóÓÐÒ»¸ö BeginTransaction ·½·¨£¬Ëü¿ÉÒÔ·µ»Ø SqlTransaction »òÕßOleDbTransaction ¶ÔÏ󡣶øÇÒÕâ¸ö¶ÔÏóÓÐ Commit ºÍ Rollback ·½·¨À´¹ÜÀíÊÂÎñ£¬±¾ÀýΪ¸üÐÂÊý¾Ý¿âÖÐijÕűíµÄÒ»¸öʾÀý¡£ Óŵã: ¼òµ¥ÐÔ ºÍÊý¾Ý¾ÝÊÂÎñ²î²»¶àµÄ¿ì ¶ÀÁ¢ÓÚÊý¾Ý¿â£¬²»Í¬Êý¾Ý¿âµÄרÓдúÂë±»Òþ²ØÁË È±µã: ÊÂÎñ²»ÄÜ¿çÔ½¶à¸öÊý¾Ý¿âÁ¬½Ó ÊÂÎñÖ´ÐÐÔÚÊý¾Ý¿âÁ¬½Ó²ãÉÏ£¬ËùÒÔÐèÒªÔÚÊÂÎñ¹ý³ÌÖÐά»¤Ò»¸öÊý¾Ý¿âÁ¬½Ó ADO.NET·Ö²¼ÊÂÎñÒ²¿ÉÒÔ¿çÔ½¶à¸öÊý¾Ý¿â£¬µ«ÊÇÆäÖÐÒ»¸öSQL SERVER Êý¾Ý¿âµÄ»°£¬Í¨¹ýÓÃSQL SERVERÁ¬½Ó·þÎñÆ÷Á¬½Óµ½±ðµÄÊý¾Ý¿â£¬µ«ÊÇÈç¹ûÊÇÔÚDB2ºÍOrcalÖ®¼ä¾Í²»¿ÉÒÔ¡£ÒÔÉÏÁ½ÖÖÊÂÎñÊǾ³£Óõ½µÄÊÂÎñ´¦Àí·½·¨¡£
·½·¨3 COM+ÊÂÎñ£¨·Ö²¼Ê½ÊÂÎñ£©
.NET Framework ÒÀ¿¿ MTS/COM+ ·þÎñÀ´Ö§³Ö×Ô¶¯ÊÂÎñ¡£COM+ ʹÓà Microsoft Distributed Transaction Coordinator (DTC) ×÷ΪÊÂÎñ¹ÜÀíÆ÷ºÍÊÂÎñе÷Æ÷ÔÚ·Ö²¼Ê½»·¾³ÖÐÔËÐÐÊÂÎñ¡£ÕâÑù¿Éʹ .NET Ó¦ÓóÌÐòÔËÐпç¶à¸ö×ÊÔ´½áºÏ²»Í¬²Ù×÷ ¶¨ÒåÒ»¸öCOM+ÊÂÎñ´¦ÀíµÄÀà TransactionScope scope = new TransactionScope(TransactionScopeOption.Required) TransactionOptionö¾ÙÀàÐÍÖ§³Ö5¸öCOM+Öµ£¨Disabled,NotSupported,Required,RequiresNew,Supported£© Disabled ºöÂÔµ±Ç°ÉÏÏÂÎÄÖеÄÈκÎÊÂÎñ¡£ NotSupported ʹÓ÷ÇÊÜ¿ØÊÂÎñÔÚÉÏÏÂÎÄÖд´½¨×é¼þ¡£ Required Èç¹ûÊÂÎñ´æÔÚÔò¹²ÏíÊÂÎñ£¬²¢ÇÒÈçÓбØÒªÔò´´½¨ÐÂÊÂÎñ¡£ RequiresNew ʹÓÃÐÂÊÂÎñ´´½¨×é¼þ£¬¶øÓ뵱ǰÉÏÏÂÎĵÄ״̬Î޹ء£ Supported &nb
Ïà¹ØÎĵµ£º
asp.netÖÐ×Ô´øµÄCutStringÖ»ÄܽØÈ¡×Ö·ûÊýÁ¿µÄ³¤¶È,µ«ÖÐÓ¢ÎÄ×Ö·ûÊýÓвîÒì,Ò»¸öÖÐÎÄ×ÖµÈͬÓÚ¶þ¸öÓ¢ÎÄ×Ö·ûµÄ¿í¶È,ÕâÑù¶Ô½ØÈ¡ºóµÄЧ¹û²»ÀíÏë.ʹÓÃÒÔϵķ½·¨¾ÍÄܽâ¾ö.
//µ÷Ó÷½·¨
string title=BLL.CutStr.CutString("±êÌâ",10);using System;
using System.Collections.Generic;
using System.Text;
namespace BLL
{
&n ......
×î½üÔÚ¿´¡¶asp.netͨÓÃÄ£¿é¼°µäÐÍϵͳ¿ª·¢ÊµÀýµ¼º½¡·£¬ÆäÖÐÓõ½ÁËMD5¼ÓÃÜ£¬´úÂëÈçÏ£º /// <summary>
/// ×Ö·û´®¼ÓÃܺ¯Êý
/// </summary>
/// <param name="strInput">ÊäÈë±»¼ÓÃܵÄ×Ö·û´®</param>
/// <returns>¼ÓÃܺóµÄ×Ö·û´®</return ......
Êý¾Ý°ó¶¨ÒÔ¼°Container.DataItemµÄ¾ßÌå·ÖÎö
Áé»îµÄÔËÓÃÊý¾Ý°ó¶¨²Ù×÷
°ó¶¨µ½¼òµ¥ÊôÐÔ:<%#UserName%>
°ó¶¨µ½¼¯ºÏ:<asp:ListBox id="ListBox1" datasource='<%# myArray%>' runat="server">
°ó¶¨µ½±í´ïʽ:<%#(class1.property1.ToString() + "," + class1.property2.ToString())%>
°ó¶¨µ½·½·¨·µ» ......
ASP.NETÒ³ÃæÌøתÓÐʲô·½·¨ÄØ£¿£¬ÏÖÔÚ¸ø´ó¼Ò½éÉÜÈýÖÖ·½·¨£¬ËûÃǵÄÇø±ðÊÇʲôÄØ£¿ÈÃÎÒÃÇ¿ªÊ¼°É£º ASP.NETÒ³ÃæÌøת1¡¢response.redirect Õâ¸öÌøתҳÃæµÄ·½·¨ÌøתµÄËٶȲ»¿ì£¬ÒòΪËüÒª×ß2¸öÀ´»Ø(2´Îpostback)£¬µ«Ëû¿ÉÒÔÌøתµ½ÈκÎÒ³Ã棬ûÓÐÕ¾µãÒ³ÃæÏÞÖÆ(¼´¿ÉÒÔÓÉÑÅ»¢Ìøµ½ÐÂÀË)£¬Í¬Ê±²»ÄÜÌø¹ýµÇ¼±£»¤¡£µ«ËÙ¶ÈÂýÊÇÆä×î´óȱÏÝ!r ......
1.ʲôÊÇcookie?
cookie ÊÇһС¶ÎÎı¾ÐÅÏ¢£¬°éËæÓû§ÇëÇó£¬ÔÚweb·þÎñÆ÷ºÍä¯ÀÀÆ÷Ö®¼ä´«µÝ¡£Óû§Ã¿´Î·ÃÎÊÕ¾µãµÄʱºò£¬
webÓ¦ÓóÌÐò¶¼¿ÉÒÔ¶ÁÈ¡cookie°üº¬µÄÐÅÏ¢¡£
¼ÙÉèÔÚÓû§ÇëÇóÄúµÄÍøÕ¾µÄij¸öÒ³Ãæʱ£¬ÄúµÄÓ¦ÓóÌÐò²»½öÊÇ·µ»ØÇëÇóµÄÒ³Ã档ͬʱҲ·µ»ØÒ»¸ö°üº¬ÈÕÆÚ
ºÍʱ¼äµÄcookie¡£Óû§µÄä¯ÀÀÆ÷ÔÚ»ñµÃÒ³ÃæµÄͬʱҲ»ñµÃ ......