HTML5¼¼Êõ

¿ªÔ´ORM¿ò¼Ü SqlSugar 3.0µÄ¾Þ´ó±ä»¯ - Ëï¿­Ðý(6)

×ÖºÅ+ ×÷ÕߣºH5Ö®¼Ò À´Ô´£ºH5Ö®¼Ò 2016-09-28 12:00 ÎÒÒªÆÀÂÛ( )

IgnoreErrorColumns : IDemos{ public void Init(){Console.WriteLine( ); using ( var db = SugarDao.GetInstance()){db.IsIgnoreErrorColumns = true ; id= db.InsertSTUDENT(, AreaName = });db.Update STUDENT(

IgnoreErrorColumns : IDemos { public void Init() { Console.WriteLine(); using (var db = SugarDao.GetInstance()) { db.IsIgnoreErrorColumns = true; id= db.Insert<STUDENT>(, AreaName = }); db.Update<STUDENT>(, AreaName = }); } } public class STUDENT { Desc:- /// Default:- /// Nullable:False id { get; set; } Desc:- /// Default:- /// Nullable:True name { get; set; } Desc:ѧУID /// Default:- /// Nullable:True ? sch_id { get; set; } Desc:- /// Default:- /// Nullable:True sex { get; set; } Desc:- /// Default:- /// Nullable:True Boolean? isOk { get; set; } public string SchoolName { get; set; } public string AreaName { get; set; } public string SubjectName { get; set; } } }

View Code

 

14¡¢ÊÂÎñ

using System; using System.Collections.Generic; using System.Linq; using System.Text; using NewTest.Dao; using Models; using System.Data.SqlClient; using SqlSugar; namespace NewTest.Demos { Tran : IDemos { public void Init() { Console.WriteLine(); using (SqlSugarClient db = SugarDao.GetInstance())//¿ªÆôÊý¾Ý¿âÁ¬½Ó { db.IsNoLock = true;//ÆôÓÃÎÞËø²éѯ db.CommandTimeOut = { db.BeginTran();//¿ªÆôÊÂÎñ //db.BeginTran(IsolationLevel.ReadCommitted);+3ÖØÔØ¿ÉÒÔÉèÖÃÊÂÊÀ¸ôÀ뼶±ð db.CommitTran();//Ìá½»ÊÂÎñ } catch (Exception) { db.RollbackTran();; } } } } }

View Code

 

15¡¢Á÷Ë®ºÅ¹¦ÄÜ

¡¡

1.±¾Õ¾×ñÑ­ÐÐÒµ¹æ·¶£¬ÈκÎתÔصĸå¼þ¶¼»áÃ÷È·±ê×¢×÷ÕߺÍÀ´Ô´£»2.±¾Õ¾µÄÔ­´´ÎÄÕ£¬ÇëתÔØʱÎñ±Ø×¢Ã÷ÎÄÕÂ×÷ÕߺÍÀ´Ô´£¬²»×ðÖØÔ­´´µÄÐÐΪÎÒÃǽ«×·¾¿ÔðÈΣ»3.×÷ÕßͶ¸å¿ÉÄܻᾭÎÒÃDZ༭Ð޸Ļò²¹³ä¡£

Ïà¹ØÎÄÕÂ
  • ½ÌÄã·Ö·ÖÖÓѧ»áÓÃpythonÅÀ³æ¿ò¼ÜScrapyÅÀÈ¡ÐÄÄ¿ÖеÄÅ®Éñ - Õ½ÉñÍõºã

    ½ÌÄã·Ö·ÖÖÓѧ»áÓÃpythonÅÀ³æ¿ò¼ÜScrapyÅÀÈ¡ÐÄÄ¿ÖеÄÅ®Éñ - Õ½ÉñÍõºã

    2016-09-01 11:00

  • ¿ªÔ´£ºASP.NET MVC+EF6+Bootstrap¿ª·¢¿ò¼Ü - NFine

    ¿ªÔ´£ºASP.NET MVC+EF6+Bootstrap¿ª·¢¿ò¼Ü - NFine

    2016-08-24 11:00

  • ¿ªÔ´µÄÄÇЩʶù £¨Ò»£©- ÈçºÎ¿´´ý¿ªÔ´ - LeftNotEasy

    ¿ªÔ´µÄÄÇЩʶù £¨Ò»£©- ÈçºÎ¿´´ý¿ªÔ´ - LeftNotEasy

    2016-08-24 10:00

  • ÈçºÎ¶ÀÁ¢¿ª·¢Ò»¸öÍøÂçÇëÇó¿ò¼Ü - Ö¸¼âϵÄÓÄÁé

    ÈçºÎ¶ÀÁ¢¿ª·¢Ò»¸öÍøÂçÇëÇó¿ò¼Ü - Ö¸¼âϵÄÓÄÁé

    2016-08-15 11:00

ÍøÓѵãÆÀ
º