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

浪淘沙12个月前后端76
    #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 图片转正

在 ASP.NET Core 中将图片旋转为正向,通常你需要处理图片的 EXIF 信息,因为一些相机和手机拍摄的照片会包含方向信息,表示照片应该如何旋转才能显示为正确的方向。可以使用一个图像处理库来实...

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

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

ubuntu 删除asp.net core 8.0

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

导出excel

@page @model xxtsoft.Web.Entry.Pages.test2Model @{ } <form method="post"&...

oss文件上传

using Aliyun.OSS; #region Oss文件上传  /// <summary>  /// O...

asp.net core razor 使用内存流 生成文件

 #region 获取简历html  var url = $"{Request.Scheme}://{Request.Host}...

发表评论    

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