WCF, Linqs and WPF

Posted on 2009-12-24
Last Modified: 2013-11-12

  Please, explain if I'm correct.

  I have two tables (clients and cities). They are obviously connected by city code. If wish to see all the clities I create a service in WCF as a Linq call returning a List (because WPF ListView needs a List) and this List<CITIES_TABLE>, looks like this. IEnumerable is not recognized by WPF in Blend. In this code Linq defines automaticaly the class that explains the table structure.

  Now I wish to query the clients and its cities by its names. In this case I need to create a special class that brings data from clients and cities tables? My return must br List<CLIENTS_CITIES>. There is no way to create this return not declaring it by hand code?

  Marco Castro
Question by:MarcoCastro
    1 Comment
    LVL 13

    Accepted Solution

    Best way that I know is to create a Stored Procedure with Joined query and where clause.
    Also any parameter you need to filter by which will be in your where clause.

    Then just drag you Stored Procedure to DBML (DBML is created when you create a Linq-To-SQL class).
    This will create a class needed for what you need to do.

    Note: Stored Procedure must return a Resultset (not just Integer).

    Then you would create WCF Web Service to access this Stored Procedure.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Suggested Solutions

    What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
    Here I am going to explain creating proxies at runtime for WCF Service. So basically we use to generate proxies using Add Service Reference and then giving the Url of the WCF service then generate proxy files at client side. Ok, what if something ge…
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    779 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

    14 Experts available now in Live!

    Get 1:1 Help Now