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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:26:15+00:00 2026-06-01T04:26:15+00:00

I mae a WCF service that contain this method : public List<LocationDB> GetLocation() {

  • 0

I mae a WCF service that contain this method :

public List<LocationDB> GetLocation()
{
    List<LocationDB> locations = null;
    using (SqlConnection connection = new SqlConnection(conn))
    {
        using (SqlCommand command = new SqlCommand())
        {
            command.Connection = connection;
            command.CommandText = string.Format("Select L_ID ,L_Name from Location");
            connection.Open();
//code to fill the locations list..

my problem is when i want to bind the result from this method in my code i do the following.

 void MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
    {
            client.GetLocationCompleted += new EventHandler<GetLocationCompletedEventArgs>(client_GetLocationCompleted);
            client.GetLocationAsync();
        }
    }

and :

void client_GetLocationCompleted(object sender, GetLocationCompletedEventArgs e)
    {
        LocationCombo.ItemsSource = e.Result;
        LocationCombo.SelectedValuePath = 
        LocationCombo.DisplayMemberPath =
    }

and finally my LocationDB Class that is located in the App_code folder in the asp web site:

     [DataContract]
public class LocationDB
{
    [DataMember]
    public int Lid { get; set; }
[DataMember]
public int SmId { get; set; }

[DataMember]
public string Lname { get; set; }

how can i bind the SelectedValePath and the DisplayMemberPath in code behind not in XAML.
Thanks

  • 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-01T04:26:17+00:00Added an answer on June 1, 2026 at 4:26 am

    From what I can tell you already have everything you need although some of it needs to be in a different order.

    void client_GetLocationCompleted(object sender, GetLocationCompletedEventArgs e)
    {
        LocationCombo.SelectedValuePath = "Lid";
        LocationCombo.DisplayMemberPath = "Lname";
        LocationCombo.ItemsSource = e.Result;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have found this piece of code in the Haskell sendfile package: http://patch-tag.com/r/mae/sendfile/snapshot/current/content/pretty/src/Network/Socket/SendFile/Linux.hsc --
i created this script in ruby to calculate mfe mae. however it returns a
I'm working on a project that involves the Fannie Mae/Freddie Mac Uniform Appraisal Dataset.
I'm trying to make an array of strings using a list of names coming
I have a controller that should add a person to the db, but in
Why am I getting this exception? package com.domain.idea; import javax.persistence.CascadeType; import javax.persistence.Entity; import javax.persistence.FetchType;
I am currently wanting to run a SQL statement that will filter my database
I'm trying to get all of my contacts as vCard. So this is my
I am trying to echo certain values if the variable $cardtype == $paymentmethod =
I am trying to get a variable on my page to equal the result

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.