Boundfield not returning count from LINQ query

I have a grouped LINQ query with a count summary line that I am binding to a gridview but the count field in the gridview just shows 'System.Data.DataRow[]'

What am I doing wrong here? Thanks!

aspx:

 <asp:BoundField DataField="Service_Name" HeaderText="Impacted services"/>
 <asp:BoundField DataField="Fieldname" HeaderText="Count"/>

vb code:

 Dim Services = From Lines In dtMain _
 Where Lines.Field(Of String)("ULTIMATE_PARENT_NAME") = lstUPs.SelectedItem.ToString _
 Group By Parent_Name = Lines.Field(Of String)("ULTIMATE_PARENT_NAME"), _
 Service_Name = Lines.Field(Of String)("THIRD_PARTY_SERVICE_CLEAN") _
 Into Fieldname = Group, Count()
 grdOuterGridView.DataSource = Services
 grdOuterGridView.DataBind()

Answers


I'm not an expert on that syntax (I use the extension methods) but it looks to me like Fieldname is being assigned the value Group, or the collection of rows that are being grouped on Parent_Name and Service_Name. Perhaps you need to define a field name for the result of Count()?

ETA: Got it. You should say Group.Count(), not Group, Count().


Need Your Help

Android: UI design question

android design user-interface

Im wondering about how to layout an activity in an application. It deals with the concept of a 'home' from study. On this page there is address information, phone numbers, etc.

Resetting a while loop

php javascript

I have found a confusing thing in a php script I am writing to generate some javascript. Here it is below, slightly simplified.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.