当前位置: 首页>>代码示例>>C#>>正文


C# Query.ORDER_BY方法代码示例

本文整理汇总了C#中Query.ORDER_BY方法的典型用法代码示例。如果您正苦于以下问题:C# Query.ORDER_BY方法的具体用法?C# Query.ORDER_BY怎么用?C# Query.ORDER_BY使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Query的用法示例。


在下文中一共展示了Query.ORDER_BY方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Query_ORDER_BY_ExpressionDESC_Collection

        public void Query_ORDER_BY_ExpressionDESC_Collection()
        {
            Query q = new Query("Products", "Northwind");

            DataSet ds = q.ORDER_BY("CategoryID", SqlFragment.DESC).
                ORDER_BY("ProductID", SqlFragment.DESC).
                ExecuteDataSet();

            //should bring 73 as first
            Assert.IsTrue(ds.Tables[0].Rows[0]["ProductID"].Equals(73));
        }
开发者ID:BlackMael,项目名称:SubSonic-2.0,代码行数:11,代码来源:QueryTest.cs

示例2: Query_ORDER_BY_Collection

        public void Query_ORDER_BY_Collection()
        {
            Query q = new Query("Products", "Northwind");
            TableSchema.Table ts = DataService.GetTableSchema("Products", "Northwind");

            DataSet ds = q.ORDER_BY(ts.GetColumn("SupplierID")).
                ORDER_BY(ts.GetColumn("ProductID")).
                ExecuteDataSet();

            //should bring 2 as first
            Assert.IsTrue(ds.Tables[0].Rows[0]["ProductID"].Equals(2));
        }
开发者ID:BlackMael,项目名称:SubSonic-2.0,代码行数:12,代码来源:QueryTest.cs

示例3: Query_ORDER_BY_DESC_Collection

        public void Query_ORDER_BY_DESC_Collection()
        {
            Query q = new Query("Products", "Northwind");
            TableSchema.Table ts = DataService.GetTableSchema("Products", "Northwind");

            DataSet ds = q.ORDER_BY(ts.GetColumn("CategoryID"), SqlFragment.DESC).
                ORDER_BY(ts.GetColumn("ProductID"), SqlFragment.DESC).
                ExecuteDataSet();

            //should bring 73 as first
            Assert.IsTrue(ds.Tables[0].Rows[0]["ProductID"].Equals(73));
        }
开发者ID:BlackMael,项目名称:SubSonic-2.0,代码行数:12,代码来源:QueryTest.cs

示例4: QueryExecuteJoinedDataSet_ORDER_BY

        public void QueryExecuteJoinedDataSet_ORDER_BY()
        {
            Query q = new Query("Products", "Northwind");
            TableSchema.Table ts = DataService.GetTableSchema("Products", "Northwind");

            DataSet ds = q.ORDER_BY(ts.GetColumn("ProductID")).ExecuteJoinedDataSet();

            //should bring 1 as first
            Assert.IsTrue(ds.Tables[0].Rows[0]["ProductID"].Equals(1));
        }
开发者ID:BlackMael,项目名称:SubSonic-2.0,代码行数:10,代码来源:QueryTest.cs

示例5: QueryExecuteJoinedDataSet_ORDER_BY_Expression

        public void QueryExecuteJoinedDataSet_ORDER_BY_Expression()
        {
            Query q = new Query("Products", "Northwind");

            DataSet ds = q.ORDER_BY("ProductID DESC").ExecuteJoinedDataSet();
            //should bring 77 as first
            Assert.IsTrue(ds.Tables[0].Rows[0]["ProductID"].Equals(77));
        }
开发者ID:BlackMael,项目名称:SubSonic-2.0,代码行数:8,代码来源:QueryTest.cs

示例6: Query_ORDER_BY_DESC

        public void Query_ORDER_BY_DESC()
        {
            Query q = new Query("Products", "Northwind");
            TableSchema.Table ts = DataService.GetTableSchema("Products", "Northwind");

            DataSet ds = q.ORDER_BY(ts.GetColumn("ProductID"), SqlFragment.DESC).ExecuteDataSet();

            //should bring 77 as first
            //Assert.IsTrue(ds.Tables[0].Rows[0]["ProductID"].Equals(77));
            Assert.IsTrue(ds.Tables[0].Rows[0]["ProductID"].Equals(77L), "77 != " + ds.Tables[0].Rows[0]["ProductID"].ToString());
        }
开发者ID:howgoo,项目名称:SubSonic-2.0,代码行数:11,代码来源:QueryTest.cs

示例7: Query_PagingTest_View

 public void Query_PagingTest_View()
 {
     Query q = new Query("Sales By Category", "Northwind");
     q.PageSize = 10;
     q.PageIndex = 1;
     q.ORDER_BY("CategoryID", "ASC");
     int counter = 0;
     using(IDataReader rdr = q.ExecuteReader())
     {
         while(rdr.Read())
             counter++;
         rdr.Close();
     }
     //should bring back all records
     Assert.IsTrue(counter == 10, "Nope - it's " + counter);
 }
开发者ID:BlackMael,项目名称:SubSonic-2.0,代码行数:16,代码来源:QueryTest.cs

示例8: Acc_QueryExecuteJoinedDataSet_ORDER_BY_DESC

        public void Acc_QueryExecuteJoinedDataSet_ORDER_BY_DESC()
        {
            Query q = new Query("Products", "NorthwindAccess");
            TableSchema.Table ts = DataService.GetTableSchema("Products", "NorthwindAccess");

            DataSet ds = q.ORDER_BY(ts.GetColumn("ProductID"), SqlFragment.DESC).ExecuteJoinedDataSet();

            //should bring 77 as first
            Assert.IsTrue(ds.Tables[0].Rows[0]["ProductID"].Equals(77));
        }
开发者ID:RyanDansie,项目名称:SubSonic-2.0,代码行数:10,代码来源:QueryTest.cs

示例9: Acc_Query_JoinedDataSet_OrderByFK

        public void Acc_Query_JoinedDataSet_OrderByFK()
        {
            Query q = new Query("Products", "NorthwindAccess");
            TableSchema.Table ts = DataService.GetTableSchema("Products", "NorthwindAccess");
            //q.OrderBy = OrderBy.Desc(ts.GetColumn("CategoryID"));
            q.ORDER_BY(ts.GetColumn("CategoryID"), "DESC");
            q.ORDER_BY(ts.GetColumn("ProductID"), "ASC");
            DataSet ds = q.ExecuteJoinedDataSet();

            //should bring 10 as first
            Assert.IsTrue(ds.Tables[0].Rows[0]["ProductID"].Equals(10));
        }
开发者ID:RyanDansie,项目名称:SubSonic-2.0,代码行数:12,代码来源:QueryTest.cs

示例10: QueryExecuteJoinedDataSet_ORDER_BY_Expression_Collection

        public void QueryExecuteJoinedDataSet_ORDER_BY_Expression_Collection()
        {
            Query q = new Query("Products", "Northwind");

            DataSet ds = q.ORDER_BY("SupplierID DESC").
                ORDER_BY("ProductID DESC").
                ExecuteJoinedDataSet();

            //should bring 48 as first 
            //Assert.IsTrue(ds.Tables[0].Rows[0]["ProductID"].Equals(48));
            Assert.IsTrue(ds.Tables[0].Rows[0]["ProductID"].Equals(48L), "48 != " + ds.Tables[0].Rows[0]["ProductID"].ToString());
        }
开发者ID:howgoo,项目名称:SubSonic-2.0,代码行数:12,代码来源:QueryTest.cs

示例11: LoadLogLevels

 /// <summary>
 /// Loads the log levels.
 /// </summary>
 private void LoadLogLevels()
 {
     Query query = new Query(Log.Schema.TableName);
       query.QueryType = QueryType.Select;
       query.SelectList = Log.Columns.MessageType;
       query.DISTINCT();
       query.ORDER_BY(Log.Columns.MessageType);
       IDataReader reader = query.ExecuteReader();
       while (reader.Read()) {
     ddlLogLevel.Items.Add(new ListItem(Enum.Parse(typeof(Logger.LogMessageType), reader[0].ToString()).ToString(), reader[0].ToString()));
       }
       ddlLogLevel.Items.Insert(0, new ListItem(LocalizationUtility.GetText("lblSelect")));
 }
开发者ID:montyclift,项目名称:dashcommerce-3,代码行数:16,代码来源:errorlogs.aspx.cs

示例12: QueryExecuteJoinedDataSet_ORDER_BY_Collection

        public void QueryExecuteJoinedDataSet_ORDER_BY_Collection()
        {
            Query q = new Query("Products", "Northwind");
            TableSchema.Table ts = DataService.GetTableSchema("Products", "Northwind");

            DataSet ds = q.ORDER_BY(ts.GetColumn("SupplierID")).
                ORDER_BY(ts.GetColumn("ProductID")).
                ExecuteJoinedDataSet();

            //should bring 38 as first (SupplierID is replaced by CompanyName)
            //Assert.IsTrue(ds.Tables[0].Rows[0]["ProductID"].Equals(38));  // 38 != 2
            Assert.IsTrue(ds.Tables[0].Rows[0]["ProductID"].Equals(2L), "2 != " + ds.Tables[0].Rows[0]["ProductID"].ToString());
        }
开发者ID:howgoo,项目名称:SubSonic-2.0,代码行数:13,代码来源:QueryTest.cs

示例13: Query_ORDER_BY_Expression_Collection

        public void Query_ORDER_BY_Expression_Collection()
        {
            Query q = new Query("Products", "Northwind");

            DataSet ds = q.ORDER_BY("CategoryID DESC").
                ORDER_BY("ProductID DESC").
                ExecuteDataSet();

            //should bring 73 as first
            //Assert.IsTrue(ds.Tables[0].Rows[0]["ProductID"].Equals(73));
            Assert.IsTrue(ds.Tables[0].Rows[0]["ProductID"].Equals(73L), "73 != " + ds.Tables[0].Rows[0]["ProductID"].ToString());
        }
开发者ID:howgoo,项目名称:SubSonic-2.0,代码行数:12,代码来源:QueryTest.cs

示例14: QueryExecuteJoinedDataSet_ORDER_BY_ExpressionDESC

        public void QueryExecuteJoinedDataSet_ORDER_BY_ExpressionDESC()
        {
            Query q = new Query("Products", "Northwind");

            DataSet ds = q.ORDER_BY("ProductID", SqlFragment.DESC).ExecuteJoinedDataSet();
            //should bring 77 as first
            //Assert.IsTrue(ds.Tables[0].Rows[0]["ProductID"].Equals(77));
            Assert.IsTrue(ds.Tables[0].Rows[0]["ProductID"].Equals(77L), "77 != " + ds.Tables[0].Rows[0]["ProductID"].ToString());
        }
开发者ID:howgoo,项目名称:SubSonic-2.0,代码行数:9,代码来源:QueryTest.cs

示例15: QueryExecuteJoinedDataSet_ORDER_BY_DESC_Collection

        public void QueryExecuteJoinedDataSet_ORDER_BY_DESC_Collection()
        {
            Query q = new Query("Products", "Northwind");
            TableSchema.Table ts = DataService.GetTableSchema("Products", "Northwind");

            DataSet ds = q.ORDER_BY(ts.GetColumn("SupplierID"), SqlFragment.DESC).
                ORDER_BY(ts.GetColumn("ProductID"), SqlFragment.DESC).
                ExecuteJoinedDataSet();

            //should bring 48 as first (SupplierID is replaced by CompanyName)
            Assert.IsTrue(ds.Tables[0].Rows[0]["ProductID"].Equals(48));
        }
开发者ID:BlackMael,项目名称:SubSonic-2.0,代码行数:12,代码来源:QueryTest.cs


注:本文中的Query.ORDER_BY方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。