1.字符串中调用参数
DataTable dt= sqlHelper.SqlConnectionInformation(connstr,sql); string rows = JsonConvert.SerializeObject(dt); string json = $"{{"total":{dt.Rows.Count},"rows":{rows}}}";
需要注意{{}}是转义的{}
1.字符串中调用参数
DataTable dt= sqlHelper.SqlConnectionInformation(connstr,sql); string rows = JsonConvert.SerializeObject(dt); string json = $"{{"total":{dt.Rows.Count},"rows":{rows}}}";
需要注意{{}}是转义的{}