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

浪淘沙1年前后端133
    #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 HttpClient post ,get

1、postvar url = "https://api.dingtalk.com/v1.0/oauth2/userAccessToken";...

asp.net core razor 远程请求 认证Basic auth 模式 body传递 json

private readonly HttpClient _httpClient;    public RemoteReq...

asp.net core sqlsugar timestamp 防sql注入方法

 string sql= "insert into ts (title,dx,zt,tsnr,tpe,jhsj,bz,guid)&...

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

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

SqlSugar

   var dt = _db.SqlQueryable<object>("select * fr...

发表评论    

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