zoukankan      html  css  js  c++  java
  • 二、添加 Insert into

    文档目录

    开始使用  初始化查询实例:

    LambdaToSql.SqlClient DB = new LambdaToSql.SqlClient();

     

    添加实体数据

    var log = new EntityModel.Log() { Guid = Guid.NewGuid(), Client = "91", IP = "127.0.0.3", Browser = "IE", CityLevels = "沈阳", Description = "说明" };
    int i= DB.InsertTble(log).ExecuteNonQuery();//返回影响的行数

     

    只添加某几列

    var log = new EntityModel.Log() { Guid = Guid.NewGuid(), Client = "91", IP = "127.0.0.3", Browser = "IE", CityLevels = "沈阳", Description = "说明" };
    int i = DB.InsertTble(log).InsertColumns(ex => new { ex.Guid, ex.Description, ex.CityLevels }).ExecuteNonQuery();

     

    忽略某些列

    var log = new EntityModel.Log() { Guid = Guid.NewGuid(), Client = "91", IP = "127.0.0.3", Browser = "IE", CityLevels = "沈阳", Description = "说明" };
    int i = DB.InsertTble(log).IgnoreColumns(ex => new { ex.Guid, ex.Description, ex.CityLevels }).ExecuteNonQuery();

     

  • 相关阅读:
    HTTP报文详解
    常用的HTTP协议
    URL详解
    一起切磋
    emacs使用指南
    SSH自动部署
    linux上应用随机启动
    让Maven正确处理javac警告
    最近的学习
    Java application 性能分析分享
  • 原文地址:https://www.cnblogs.com/shuyu/p/7504953.html
Copyright © 2011-2022 走看看