Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 109219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:02:06+00:00 2026-05-11T02:02:06+00:00

For example, in my WCF, if I have a Customer table and an Order

  • 0

For example, in my WCF, if I have a Customer table and an Order table that have an association to each other on Customer ID.

I want to get the Count of the number of Orders for each Customer.

In regular VB code I can just do this:

Dim CustID As Integer = 1234 Dim cust As New MyService.Customer() cust = cust.GetCustomer(CustID) Response.Write(cust.Orders.Count) 

The above code works fine but if I want to access the same from within a GridView, it doesn’t seem to react the same way (albiet, from a different method but I’m applying the same pricipals to each method though)

<asp:ObjectDataSource ID='odsCustomers' runat='server' SelectMethod='GetCustomers' TypeName='MyService.Customer' />  <asp:GridView ...> ... <Columns>     <asp:BoundField DataField='Orders.Count' HeaderText='Order Count' /> </Columns> ... </asp:GridView> 

So how could I do something like this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T02:02:06+00:00Added an answer on May 11, 2026 at 2:02 am

    You could try adding a partial method to the Customer class called OrderCount and reference that in your BoundField. Right click you dbml file and go to View Code then add.

    VB

    Partial Public Class Customer      Public ReadOnly Property OrderCount As Integer         Get             Return Me.Orders.Count         End Get     End Property  End Class 

    C#

    public partial class Customer {          public int OrderCount {         get { return this.Orders.Count; }     } } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do the timeouts work in WCF? I know for example that you can
Does anyone know of a good example of how to expose a WCF service
I'm trying to follow a simple example of AJAX-enabled WCF Service like: http://www.pluralsight.com/community/blogs/fritz/archive/2008/01/31/50121.aspx I'm
In my knowledge, the RESTful WCF still has .svc in its URL. For example,
Example: You have a shortcut s to SomeProgram in the current directory. In cmd.exe
Example I have Person , SpecialPerson , and User . Person and SpecialPerson are
I have found this example on StackOverflow: var people = new List<Person> { new
I am looking for any examples or guides to using Linq over WCF (n-tier
Example: select ename from emp where hiredate = todate('01/05/81','dd/mm/yy') and select ename from emp
example: a_list = [1, 2, 3] a_list.len() # doesn't work len(a_list) # works Python

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.