0

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?

4

2 回答 2

1
  1. 您应该将数据打包到 WCF 服务公开的服务实体中。

  2. SL2 中的 WCF 基本 HTTP 绑定,在 SL3 中,您有更多选项

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

于 2009-05-07T23:56:32.073 回答
0

对不起,但你做错了。

数据集已死。
数据集是最糟糕的做法。
数据集不是解决任何问题的可行技术解决方案。

对于数据访问,您有多种选择:
1. Entity Framework (Microsoft)
2. Linq-To-Sql (Microsoft)
3. NHibernate / ActiveRecord (Open source)
4. 更多属于 ORM 类别的框架(Object Relational Mapper ) 或持久层。

要开始使用 Microsoft 数据平台,请允许我推荐“我如何”Microsoft 数据视频 @ http://msdn.microsoft.com/en-us/data/cc300162.aspx

对于通过网络传输的数据,您有几个选择:
1.不是 Web服务——那些也已经死了。伤心,我知道。
2. WCF
3. ADO.Net 数据服务
4. RIA 服务

每个可能的 ORM 框架选择和通信框架都有优缺点。人们对选择他们的支持框架非常虔诚,所以我会避免提出建议。只需选择最适合您的一种。
不,数据集不算数。

于 2009-11-05T23:35:32.647 回答