C# LINQ Ignoring empty values in datatable -


I have a statistic that I have grouped as follows:

  var result = data From {group = data.Field & lt; String & gt; New Group {gr.p.Key.Group, PRAS = grp.Average (c => Convert. ToDouble (c.Field & lt; String & gt; to view ("group_no")} Now, the average function is also calculating empty cells in its calculation. For example, with 10 cells populated with only 5 values. I want the sum of 5 values ​​divided by 5.  

How can I ensure that what I want?

Thanks.

Maybe something like this:

PRAS = grp.Select (line = & gt; row.Field & lt; string & gt; ("PAKT Total"). Where (S => String.IsNullOrEmpty ()). Repeat (convert.). Additional ()

Comments