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

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


相关文章

asp.net core Razor 部门视图Partial Views 用法

1、在/Pages/Shared/目录下创建设视图文件 _top.cshtml2、在razor页面中进行引用@await Html.PartialAsync("_top&...

ubuntu 删除asp.net core 8.0

1. 查找已安装的 ASP.NET Core 8.0 版本dotnet --list-runtimes dotnet --list-sdks2. 删除 ASP.NET Core...

asp.net core razor .cshtml.cs 如何改变写入中文后变成ANSI格式为utf-8

根目录下,添加.editorconfig并写入[*.cshtml.cs] charset = utf-8已生成的文件另存为 utf-8格式...

DBeaver连接oracle 下载驱动报错

https://blog.csdn.net/weixin_45764765/article/details/124327194...

asp.net core 中文 url 编码

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

asp.net core razor onpost

不管 OnGet 填充多少东西OnPost 必须再填一次因为 Razor Pages 不会“记住” ViewModelPOST 后是重新执行一个请求,Model 全部重新创建。不像 WebForms,...

发表评论    

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