Linq2Sql executing stored procedures (Silverlight)

Posted on 2009-12-16
Last Modified: 2013-12-17

I'm trying to retrieve whole custom table from a stored procedure ( SLClient_ContractPage() ) in (.Net C# Silverlight), but with no success so far;

Using the ORM designer (drag-drop stored procedure, recreated the dbml file)

Created funciton in the DomainService (web project):

public IList<SLClient_ContractPageResult> SP_ContractsData()
            return this.Context.SLClient_ContractPage().ToList<SLClient_ContractPageResult>();

Then, from DomainContext (on silverlight project), when I execute the above method and gather the results, the number of it is proper (105 records in my case), but only one record is repeated 105 times!

I debugged the situation, and seen that on the server I have retrieved the all data, but on the client only the first record is repeating itself for as many times as there is data in the server...

Can you tell me what could cause this situation?
Question by:VoxSis
    LVL 96

    Expert Comment

    by:Bob Learned
    If you execute the stored procedure, and don't convert it to an IList, do you get the correct results?
    LVL 3

    Accepted Solution


    The actual mistake was in the metadata file, where I give the [Key] attribute to property;
    Well, after marking the right property with the [Key] attribute, everything worked fine;

    Thanks to TheLearnedOne for the interest

    Featured Post

    Gigs: Get Your Project Delivered by an Expert

    Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

    Join & Write a Comment

    A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    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!
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    746 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

    15 Experts available now in Live!

    Get 1:1 Help Now