Skip to main content

Microsoft Silverlight

Answered Question return list<object> from WCF to SilverlightRSS Feed

(0)

magozeta
magozeta

Member

Member

0 points

30 Posts

return list<object> from WCF to Silverlight

 hello all!

How can I return a List<object> from wcf to page.xaml.cs

 

I have just saw this post: http://forums.silverlight.net/forums/t/23643.aspx but I didn't resolve my problem

bykinag
bykinag

Member

Member

137 points

51 Posts

Re: return list<object> from WCF to Silverlight

without the theory does not get practice, reed this

►(If this has answered your question, please click on "mark as answer" on this post. Thank you!)
NET / Silverlight Developer need work.

Pravinkumar R. D.
Pravinku...

Contributor

Contributor

4300 points

708 Posts

Re: return list<object> from WCF to Silverlight

Hi,

Check this blog-

http://pkrd.blogspot.com/2009/08/silverlight-and-database-without-linq.html

It may help you out-

If it is not a database, then simply create a class for example Student-

public class Students
{
      public int InstanceID { get; set; }
      public int StudentID { get; set; }
      public string Subject { get; set; }
      public string Result { get; set; }
      public string FailedReason { get; set; }
}

Then Create a WCF Service method which will return List<Students> class by adding the multiple instances to collection of Students object.

public List<Students> FetchStudentResult() 
{

         List<Students> studCol=new List<Students>();

        studCol.Add(new Student(){StudentID=10,Subject="Eng", Result="Pass",FailedReason="None"}); 

        return studCol;

}

Thanks,

Pravin

"Please mark as answered, if this answers your question"

 

Sergey.Lutay
Sergey.L...

Contributor

Contributor

7250 points

1,351 Posts

Re: return list<object> from WCF to Silverlight

Hi,

Try to re-create service reference and configure it to return a list at Service Reference Settings window. That window open with Advenced... button at Add Service Reference window.

(If this has answered your question, please click on "mark as answer" on this post. Thank you!)

Blog

Twitter

Sincerely,
Sergey Lutay

magozeta
magozeta

Member

Member

0 points

30 Posts

Re: return list<object> from WCF to Silverlight

 thanks all!!!

I must return a list of different object each one.

every object is a table in my database. List<object> because I have different structure for every db table.

How can I return from wcf to SL3 a list of different object?

thanks

bykinag
bykinag

Member

Member

137 points

51 Posts

Re: return list<object> from WCF to Silverlight

 Listen, you give full information at the top, why you would not use it?

►(If this has answered your question, please click on "mark as answer" on this post. Thank you!)
NET / Silverlight Developer need work.

Pravinkumar R. D.
Pravinku...

Contributor

Contributor

4300 points

708 Posts

Answered Question

Re: return list<object> from WCF to Silverlight

Hi,

Try to use StoreProcedure. It will help you to return multiple result sets. Check the articles below-

http://blogs.microsoft.co.il/blogs/bursteg/archive/2007/10/05/linq-to-sql-stored-procedures-with-multiple-results-imultipleresults.aspx

http://blogs.msdn.com/swiss_dpe_team/archive/2008/02/04/linq-to-sql-returning-multiple-result-sets.aspx

Thanks,

Pravin

"Please mark as answered, if this answers your question"

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities