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();

     

  • 相关阅读:
    exp 和imp 与expdp / impdp 区别
    nginx优化
    nginx root alias proxypass
    mysql3
    logrotate 用法
    SQL执行顺序
    http与RPC的关系
    docker
    windows 时间同步
    Java生成指定长度的随机字符串
  • 原文地址:https://www.cnblogs.com/shuyu/p/7504953.html
Copyright © 2011-2022 走看看