views:

901

answers:

3

So I have a WCF Service that gets a result set from a database (not SQL) - I can get this data as a DataTable, string[][], etc.

I can't use LINQ or ADO.NET Entity Framework very easily as it's not coming from an SQL DB.

So my question is:

-What's the best way to package this data for transmission across the wire? I can use any data structure supported in Silverlight.

-What's a good way to consume it?

-Is there any easy way to connect it to a DataGrid?

+1  A: 
  1. You should package data into service entities that are exposed by your WCF Service.

  2. WCF basic HTTP binding in SL2, in SL3 you have many more options

  3. <DataGrid ItemsSource="{Binding MyCollectionOfObjects}" />

markti
A: 

You can use the tools from http://www.silverlightds.com to do this and it makes binding cake.

vince
A: 

Sorry, but you're doing it wrong.

Datasets are dead.
Datasets are worst practices.
Datasets are not a viable technical solution for any problem.

For data access you have multiple options:
1. Entity Framework (Microsoft)
2. Linq-To-Sql (Microsoft)
3. NHibernate / ActiveRecord (Open source)
4. Many more frameworks that fall in the category of ORMs (Object Relational Mapper) or Persistence Layers.

To get started on the Microsoft Data platforms allow me to suggest the "How Do I" microsoft data videos @ http://msdn.microsoft.com/en-us/data/cc300162.aspx

For data transmission over the wire you've a got a few options:
1. Not Webservices - those are dead too. Sad, I know.
2. WCF
3. ADO.Net Data Services
4. RIA Services

There are cons and pros for each possible ORM framework selection and Communication framework. People get very religious about choosing their supporting frameworks, So I'll avoid going into recommendations. Just choose the one that works best for you.
And No, DataSets don't count.

JustinAngel