asp.net core SqlSugar对SugarParameter 参数的调试

浪淘沙9个月前后端162
string sql = "select id,xm from stu where phone=@phone and pass=@pass and zcwc=true order by id desc limit 1";
var par = new List<SqlSugar.SugarParameter>();
par.Add(new SqlSugar.SugarParameter("@phone", regphone));
par.Add(new SqlSugar.SugarParameter("@pass", SecurityHelper.md5(pass)));
var dt = _db.Ado.GetDataTable(sql, par);

string debugSql = sql;
foreach (var p in par)
{
    debugSql = debugSql.Replace(p.ParameterName, $"'{p.Value}'");
}
          
return Content(debugSql);


相关文章

返回月份当天日期

  int daysInMonth = DateTime.DaysInMonth(_yf.Year, _yf.Month);...

asp.net core furion 返回错误信息

asp.net core furion 返回错误信息

  if (string.IsNullOrEmpty(jd) || string.IsNullOrEmpty(wd))   {...

asp.net core rzaor page 中的ViewComponent 视图用法

asp.net core rzaor page 中的ViewComponent 视图用法

1、/Pages/Components 新建:MyViewComponent.csusing Microsoft.AspNetCore.Mvc; namespace xxts...

sqlite数据库备份

  public IActionResult OnPostBf()   {      ...

发表评论    

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