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 9157097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:55:49+00:00 2026-06-17T12:55:49+00:00

Just a quick question as I’m struggling to get my Web Service working. Basically

  • 0

Just a quick question as I’m struggling to get my Web Service working.
Basically I followed a tutorial as I’m new to Windows Phone and Databases,

"http://studentguru.gr/b/dt008/archive/2010/12/02/querying-a-database-on-windows-phone-7-using-wcf.aspx"

However i’m using my own database, a .sdf file created in visual studio

I managed to create the service, the references and all the methods it said to make.
However when I try to grab the data from the service at runtime it just returns

       Timesheet_System.Servicereference.TimeData
       Timesheet_System.Servicereference.TimeData
       Timesheet_System.Servicereference.TimeData
       Timesheet_System.Servicereference.TimeData

For all 4 of the items in the database.

Does anyone know a reason why?
Thanks a lot.
Code Below:

I have a data service in an asp.net site, and an ado.net data model,
then i have a service reference in the phone app and 2 methods to call data
This is the data service code in the asp.net application

namespace TimesheetDataSite
{
     [ServiceContract(Namespace = "")]
    [SilverlightFaultBehavior]
    [AspNetCompatibilityRequirements(RequirementsMode =     AspNetCompatibilityRequirementsMode.Allowed)]
public class Service1
{
    [OperationContract]
    public List<TimeData> DoWork()
    {
        // Add your operation implementation here
        using (TimeDataEntities2 entities = new TimeDataEntities2())
        {
            var alldata = from x in entities.TimeDatas select x;
            return alldata.ToList();
        }
    }

    // Add more operations here and mark them with [OperationContract]
}

}

the 2 methods in the phone app

private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
        {
        Service1Client client = new Service1Client();

        client.DoWorkCompleted +=
            new EventHandler<DoWorkCompletedEventArgs>(client_DoWorkCompleted);
        client.DoWorkAsync();
    }
    void client_DoWorkCompleted(object sender, DoWorkCompletedEventArgs e)
    {
        if (e.Error == null)
        {

            listBox1.ItemsSource = e.Result;
        }
    }

}
  • 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. Editorial Team
    Editorial Team
    2026-06-17T12:55:50+00:00Added an answer on June 17, 2026 at 12:55 pm

    TimeData As per my comment, try the following:

    void client_DoWorkCompleted(object sender, DoWorkCompletedEventArgs e)
    {
        if (e.Error == null)
        {
            listBox1.DisplayMemberPath = "PropertyA";
            listBox1.ItemsSource = e.Result;
        }
    }
    

    Where PropertyA is the name of the property on TimeData that you want to display.

    Like I said, I don’t have Visual Studio available to test this but it should work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just a quick question, how do I get pypy to recognize third pary modules
just a quick question. I wonder how many characters count for \n (new line
Just a quick question my textbox1.text seems to get focus when I run the
just a quick question to hopefully get pointed in the right direction. I took
Just a quick question, how to I get a list of directories inside a
just a quick question. I'm working on a project in Sharepoint Server 2010 standard
Just quick question about typing. If I type into ghci :t [(a,3)] I get
just a quick question, was trying different ways to accomplish this, but ended with
Just a quick question.. Following opening a text file in a separate definition (no
Just a quick question about ReadWriteLocks in Java (specifically the ReentrantReadWriteLock implementation) as I

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.