asp.net core sqlsugar sql原生采用参数形式

浪淘沙2年前后端261
    #region 入库

    string sql = "insert into  xm_bfjh(xmid,userid,userxm,xmjd,bfsx,bfsj,pic,jd,wd,country,province,city,district,township,formatted_address,json) values(@xmid,@userid,@userxm,@xmjd,@bfsx,@bfsj,@pic,@jd,@wd,@country,@province,@city,@district,@township,@formatted_address,@json)";
    var parameters = new List<SugarParameter>
{
    new SugarParameter("@xmid", xmid),
    new SugarParameter("@userid", userid),
    new SugarParameter("@userxm", userxm),
    new SugarParameter("@xmjd", xmjd),

    new SugarParameter("@bfsx", bfsx),
    new SugarParameter("@bfsj", DateTime.Now),
    new SugarParameter("@pic", pic),
    new SugarParameter("@jd", jd),

    new SugarParameter("@wd", wd),
    new SugarParameter("@country", country),
    new SugarParameter("@province", province),
    new SugarParameter("@city", city),

    new SugarParameter("@district", district),
    new SugarParameter("@township", township),
    new SugarParameter("@formatted_address",formatted_address),
    new SugarParameter("@json", response)
};
    var Rn = await _db.Ado.ExecuteCommandAsync(sql, parameters);

    #endregion


相关文章

Microsoft Visual Studio Installer Projects 2022的安装与使用

https://www.cnblogs.com/jiayezi/p/15740161.html...

postgresql 迁移数据库,使用sql命令

pg_dump -d mydb -f mydb.sql psql -d mydb_new -f mydb.sql...

asp.net core 值为空时,页面@Model.sx.Rows[0]["sxqymc"].ToString()的处理方法

  #region 读取实习信息   sx = await _db.Ado.GetDataTableAsync($&q...

asp.net core 获取当前url

  site = $"{Request.Scheme}://{Request.Host}";...

asp.net core 检测上传文件为图片格式

  #region 检测图片格式   var validMimeTypes = new[] { &...

取消 "将 null 文本或可能的 null 值转换为不可为 null 类型。 "提示

在 .csproj 文件中添加或修改:<PropertyGroup>  <Nullable>disable</Nullable></Pro...

发表评论    

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。