• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 618
  • Last Modified:

Linq2Sql executing stored procedures (Silverlight)


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?
1 Solution
Bob LearnedCommented:
If you execute the stored procedure, and don't convert it to an IList, do you get the correct results?
VoxSisAuthor Commented:

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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now