How to get a value from my data that is being returned.

Posted on 2009-02-09
Last Modified: 2013-12-17
I am working with C#. I am calling a service that returns what looks like rows in a table. I need to know how to get only one value. The value is for
the "ClubName" How can I do this? Below is my C# code and the contents the ClientClub var variable.

var clientClub = ClientService.GetClubs(); // C# code

When I hover over in the debugger or do a quick watch, this comes back:

clientClub = {SELECT [t0].[ClubID] AS [ClubId], [t0].[ClubCode] AS [Code], [t0].[ClubName] AS [Name], [t0].[ClubDescription] AS [Description], [t0].[SortOrder]
FROM [dbo].[Club] AS [t0]
ORDER BY [t0].[SortOrder]
var clientClub = ClientService.GetClubs(); // C# code see contents in the debugger below:

//The stuff below appears when I hover over my clientClub variable in the debugger.

clientClub = {SELECT [t0].[ClubID] AS [ClubId], [t0].[ClubCode] AS [Code], [t0].[ClubName] AS [Name], [t0].[ClubDescription] AS [Description], [t0].[SortOrder]

FROM [dbo].[Club] AS [t0]

ORDER BY [t0].[SortOrder]

Open in new window

Question by:brgdotnet
    1 Comment
    LVL 22

    Accepted Solution

    try this

    clientClub = {SELECT [t0].[ClubName] AS [Name] FROM [dbo].[Club] AS [t0] ORDER BY [t0].[SortOrder]}

    Open in new window


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
    A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now