Posted By

leonbda on 01/21/09


Tagged

count ObjectDataSource ListT


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

umang_nine


ListT - count records from ObjectDataSource


 / Published in: C#
 

Get number of record from ObjectDataSource if method returns ListT object.

  1. // total label
  2. protected void ObjectDataSource1_Selected(object sender, ObjectDataSourceStatusEventArgs e)
  3. {
  4. if (e.Exception == null)
  5. {
  6. List<ActualGroup> DPcount = (List<ActualGroup>)e.ReturnValue;
  7. if (DPcount != null && DPcount.Count > 0)
  8. TotalLabel.Text = DPcount.Count.ToString();
  9. else
  10. TotalLabel.Text = "0";
  11. }
  12. }

Report this snippet  

You need to login to post a comment.