Пример #1
0
        public void Test(string sql)
        {
            //string sql = "select top " + n + " * from TestEntity";
            //DbConnection conn = new SqlConnection(DbHelper.ConnectionString);
            //DbCommand CurrentDataReadCommand = null;
            //conn.Open();
            //CurrentDataReadCommand = new SqlCommand(sql, (SqlConnection)conn);
            //CurrentDataReadCommand.CommandType = System.Data.CommandType.Text;

            //DbDataReader r;

            //r = CurrentDataReadCommand.ExecuteReader(CommandBehavior.Default);

            //r.Close();
            //conn.Close();
            var list = DBExtend.ExecList <TestEntityCRL>(sql);
        }
Пример #2
0
        public List <Product> getList()
        {
            string sql = "select top 30 * from Product";

            return(DBExtend.ExecList <Product>(sql));
        }