/// <summary>
 /// Handles the Entity PerformGetDbCount Event of the LLBLGenProDataSource
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void OrdersDS_PerformGetDbCount(object sender, PerformGetDbCountEventArgs2 e)
 {
     using (DataAccessAdapter adapter = new DataAccessAdapter())
     {
         e.DbCount = (int)adapter.GetScalar(OrderFields.OrderId, AggregateFunction.Count);
     }
 }
 /// <summary>
 ///  Handles the LLBLGenProDataSource PerformGetDbCount Event which is raised when LivePersistence is set to false and a GetDbCount has to be performed
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void EmployeeDetailsDS_PerformGetDbCount(object sender, PerformGetDbCountEventArgs2 e)
 {
     // We don't have paging here.
     // The FormView always fetches one entity at a time, based on the selected entity of the GridView
     e.DbCount = 1;
 }