Dapper 框架

 

 

 

/// 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(sql);
                DataTable dt = ToDataTable(idt);
            }

转载于:https://www.cnblogs.com/chirs888888/p/11608117.html

你可能感兴趣的:(Dapper 框架)