Skip to main content

Microsoft Silverlight

Answered Question accessing dataset from webservice methodRSS Feed

(0)

aditi123456
aditi123456

Member

Member

2 points

25 Posts

accessing dataset from webservice method

Hi,

I am trying to return a dataset from the webservice, but it shows an error arrayofXElement not found.

What could be the reason?Is it possible to return a dataset from a webservice?

If not, could you tel me the work around for this?

 Thank you.

ccoombs
ccoombs

Contributor

Contributor

5168 points

758 Posts

Re: accessing dataset from webservice method

 you can't use datasets in silverlight.  or datatables, or datarows...

you need to return a list of custom business objects.

aditi123456
aditi123456

Member

Member

2 points

25 Posts

Re: accessing dataset from webservice method

hi,

could you point me to a sample?

ccoombs
ccoombs

Contributor

Contributor

5168 points

758 Posts

Re: Re: accessing dataset from webservice method

 its no different than a normal webmethod.  instead of returning a dataset, you'd return a list of YourObject.

this video is extremely helpful:

http://silverlight.net/learn/learnvideo.aspx?video=47177

HarshBardhan
HarshBar...

Star

Star

9908 points

1,719 Posts

Answered Question

Re: accessing dataset from webservice method

Hi,

You can use Linq to Xml Classes and can return List of Objects instead of returning dataset..

Mark as answer if this post answered your question.

Harsh Bardhan

murtaza.dharwala
murtaza....

Participant

Participant

1659 points

378 Posts

Re: Re: accessing dataset from webservice method

i would suggest to use Enitity Model instead of datasets to work with Silverlight application which connects to the database.

Entity Model is easy to create and query using Linq to object.

you can create WCF service for silverlight and in those service return the Entities not the datasets.

dataset , datatable are not available in sivlerlight

Murtaza Dharwala
Diaspark Inc.
www.diaspark.com
email:murtaza.dharwala@diaspark.com


Please remember to click “Mark as Answer” on the post that helps you

aditi123456
aditi123456

Member

Member

2 points

25 Posts

Re: Re: accessing dataset from webservice method

If I use wcf service its giving a crossdomainpolicy error although I added the required files...

murtaza.dharwala
murtaza....

Participant

Participant

1659 points

378 Posts

Re: Re: Re: accessing dataset from webservice method

i Had a similar thing when I was new to SL.

The mistake i was doing was that SL application was set as the startup project

I guess you try and set the website as startup project

Murtaza Dharwala
Diaspark Inc.
www.diaspark.com
email:murtaza.dharwala@diaspark.com


Please remember to click “Mark as Answer” on the post that helps you
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities