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

浪淘沙2年前后端199
    #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


相关文章

JNTemplate 模板标签读取dt数据

一、模板标签using JinianNet.JNTemplate; private readonly SqlSugar.ISqlSugarClient _db;...

asp.net core 取得页面form中所有表单值

public IActionResult OnPostSubmit()         { &n...

点击按钮,禁用提示,加导出word

@page @model xxtsoft.Web.Entry.Pages.sysadmins.kh.kh_outModel @{     Lay...

asp.net core 中文 url 编码

 return Redirect("tj_send?fst=" + fst + "&rq1=" + rq1 + "&rq2=...

asp.net core 获取url及参数

  var url = $"{Request.Scheme}://{Request.Host}{Request.Path}{Request....

asp.net core razor 使用ClosedXML.Excel 导出表格

            using var workbook...

发表评论    

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