Пример #1
0
 public void ExecuteDataSetByProcedure()
 {
     using (var ds = NorthwindAdoRepository.ExecuteDataSetByProcedure(GetCustomerOrderHistorySql, CustomerTestParameter)) {
         Assert.AreEqual(ds.Tables.Count, 1);
         Assert.Greater(ds.Tables[0].Rows.Count, 0);
         Console.WriteLine("RowCount=[{0}]", ds.Tables[0].Rows.Count);
     }
 }
Пример #2
0
        public void ExecuteDataSetByProcedure()
        {
            var spName = NorthwindAdoRepository.QueryProvider.GetQuery("Order, CustomerOrderHistory");

            using (var cmd = NorthwindAdoRepository.GetProcedureCommand(spName)) {
                using (var ds = NorthwindAdoRepository.ExecuteDataSet(cmd, CustomerTestParameter)) {
                    Assert.AreEqual(ds.Tables.Count, 1);
                    Assert.IsFalse(ds.Tables[0].HasErrors);
                    Assert.Greater(ds.Tables[0].Rows.Count, 0);
                }
            }

            spName = NorthwindAdoRepository.QueryProvider.GetQuery("CustomerOrdersDetail");
            using (var ds = NorthwindAdoRepository.ExecuteDataSetByProcedure(spName, OrderTestParameter)) {
                Assert.AreEqual(ds.Tables.Count, 1);
                Assert.IsFalse(ds.Tables[0].HasErrors);
                Assert.Greater(ds.Tables[0].Rows.Count, 0);
            }
        }