LINQ to SQL类

一、对数据库执行代码语句

JTTransactionApprovalDataContext db = DbHelper.GetDataContext()//寻找链接数据库的字符串

SysLoginLog log = new SysLoginLog();
log.UserAccount = user.UserAccount;
log.UserName = user.Name;

1、  db.SysLoginLog.InsertOnSubmit(log);//把log对象添加到sysLinginlog这张表的linq集中;

2、 db.SubmitChanges();//对插入,修改,删除的修改的对象级,并实现对数据库的修改;

3、string sql = "update PartyMember set isDeleted='1' where guid in ('" + sArray[i] + "')";

      db.ExecuteCommand(sql);//执行sql语句

 

posted @ 2021-11-17 15:51  猴猴手记  阅读(60)  评论(0编辑  收藏  举报
浏览器标题切换
浏览器标题切换end