/// Dapper 框架应用例子
/// 1. NuGet安装 Dapper
/// 2. using 就可以使用下面例子
string sql = "SELECT SNAME,SUSER,SDATE,SFLAG,SNUM,CST1,CST2 FROM IIDB_SYN";
string connstring = ConfigurationManager.ConnectionStrings["Model2conn"].ConnectionString;
using (IDbConnection db = new SqlConnection(connstring))
{
var idt = db.Query<Mode.IIDB_SYN>(sql);
DataTable dt = ToDataTable(idt);
}
原文地址:https://www.cnblogs.com/chirs888888/p/11608117.html
时间: 2024-10-21 17:57:10