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

  • Home
  • SEARCH
  • 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 1041861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:25:04+00:00 2026-05-16T15:25:04+00:00

I have Silverlight application that retrieves data from the database through a WCF Service.

  • 0

I have Silverlight application that retrieves data from the database through a WCF Service. What my application have to do is to display the referent data anytime a button gets MouseOvered. I did it in a way that that when a button gets MouseOvered, I called my service and retrieved the data, but it generetad a big delay. Now, I think that another way should be making a list of all objects from the table, and just searching the id in the list when the action is triggered. I started coding, but it resulted in fail (and such an ugly piece of code).

My Working Code

private void MouseOverHarbor(object sender, RoutedEventArgs e)
{
    Ellipse thisPath = (Ellipse)sender;
    DataRetrieverReference.DataRetrieverClient webService = new DataRetrieverReference.DataRetrieverClient();
    webService.GetDataCompleted += new EventHandler<DataRetrieverReference.GetDataCompletedEventArgs>(webService_GetDataCompleted);
    webService.GetDataAsync(Convert.ToInt32(thisPath.DataContext));
}

void webService_GetDataCompleted(object sender, WebPortos.DataRetrieverReference.GetDataCompletedEventArgs e)
{
    NameField.Text = e.Result.Name;
    CityField.Text = e.Result.City;
    StateField.Text = e.Result.State;
    CompanyField.Text = e.Result.Company;
}

What I tried to do

private List<vwPortos_SEP> harborList;
private int counter;

public Brasil()
{
    InitializeComponent();
    this.harborList = new List<vwPortos_SEP>();

    DataRetrieverClient webService = new DataRetrieverClient();
    webService.GetCounterCompleted += new EventHandler<GetCounterCompletedEventArgs>(webService_GetCounterCompleted);
    webService.GetCounterAsync();
    webService.GetDataCompleted += new EventHandler<DataRetrieverReference.GetDataCompletedEventArgs>(webService_GetDataCompleted);

    for (int i = 0; i < counter; i++)
    {                                
        webService.GetDataAsync(i);
    }               

}

void webService_GetDataCompleted(object sender, WebPortos.DataRetrieverReference.GetDataCompletedEventArgs e)
{
    MessageBox.Show("It works!");//It doesn't work!
    try
    {
        this.harborList.Add(e.Result);
    }
    catch (Exception exc)//It doesn't even throw ecxpetions, this method is never reached.
    {
        MessageBox.Show(exc.Message);
        MessageBox.Show(exc.InnerException.Message);
    }
}

Maybe I’m missing something really big, but my webService_GetDataCompleted method is never reached.

Thanks in advance folks!

  • 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-05-16T15:25:05+00:00Added an answer on May 16, 2026 at 3:25 pm

    Is this call:

    webService.GetCounterAsync();
    

    used to set counter?

    If so you’re not letting it finish before looping with counter as the termination value. It’s highly likely that counter is still 0 so your GetDataAsync calls aren’t happening.

    for (int i = 0; i < counter; i++)
    {                                
        webService.GetDataAsync(i);
    }
    

    Move this code into your webService_GetCounterCompleted method, so your code becomes:

    public Brasil()
    {
        InitializeComponent();
        this.harborList = new List<vwPortos_SEP>();
    
        DataRetrieverClient webService = new DataRetrieverClient();
        webService.GetCounterCompleted +=
            new EventHandler<GetCounterCompletedEventArgs>(webService_GetCounterCompleted);
        webService.GetCounterAsync();
    }
    
    void webService_GetCounterCompleted(object sender,
             WebPortos.DataRetrieverReference.GetCounterCompletedEventArgs e)
    {
        webService.GetDataCompleted +=
         new EventHandler<DataRetrieverReference.GetDataCompletedEventArgs>(webService_GetDataCompleted);
    
        for (int i = 0; i < counter; i++)
        {                                
            webService.GetDataAsync(i);
        }
    }
    

    Plus your existing webService_GetDataCompleted method.

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

Sidebar

Ask A Question

Stats

  • Questions 532k
  • Answers 532k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Okay, I fiured it out. I was setting the selectedIndex… May 17, 2026 at 12:05 am
  • Editorial Team
    Editorial Team added an answer Netbeans doesn't really factor into it. Just run 'grails install-plugin… May 17, 2026 at 12:05 am
  • Editorial Team
    Editorial Team added an answer Look at FontSquirrel - http://fontsquirrel.com The Goggle font directory -… May 17, 2026 at 12:05 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have a Silverlight application that needs to retrieve some data from my database.
I have an application that uses Silverlight and ASP.NET as a front-end. It retrieves
my WCF service it's used by a Silverlight application to retrieve data. I've no
The Scenario Currently I have a C# Silverlight Application That uses the domainservice class
The Scenario I have written a Silverlight 3 Application that uses an SQL Server
I have a Silverlight application that displays a map, and my intention is, when
I have a Silverlight application that I am maintaining. I am currently using Visual
I have a Silverlight application that has three regions that will host the same
I have a Silverlight Application, that uploads file(s) to a Sharepoint Site. I got
I have a silverlight web application that maybe open for days. It uses a

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.