使用 Silverlight DataGrid 使用数据库结果集

发布于 2024-07-16 16:57:36 字数 342 浏览 10 评论 0原文

所以我有一个 WCF 服务,它从数据库(而不是 SQL)获取结果集 - 我可以将此数据作为 DataTablestring[][] 等获取。

我无法非常轻松地使用 LINQ 或 ADO.NET 实体框架,因为它不是来自 SQL 数据库。

所以我的问题是:

  • 打包这些数据以便通过网络传输的最佳方法是什么? 我可以使用 Silverlight 支持的任何数据结构。

  • 有什么好的食用方法吗?

  • 是否有任何简单的方法可以将其连接到 DataGrid?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

允世 2024-07-23 16:57:36
  1. 您应该将数据打包到 WCF 服务公开的服务实体中。

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

  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}" />

被翻牌 2024-07-23 16:57:36

抱歉,但你做错了。

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

对于数据访问,您有多种选择:
1.实体框架(微软)
2. Linq-To-Sql (微软)
3. NHibernate / ActiveRecord(开源)
4. 更多属于 ORM(对象关系映射器)或持久层类别的框架。

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

对于通过线路传输数据,您有几个选项:
1. 不是 Web 服务 - 这些也已经死了。 悲伤,我知道。
2.WCF
3. ADO.Net数据服务
4. RIA 服务

每个可能的 ORM 框架选择和通信框架都各有利弊。 人们对于选择他们的支持框架非常虔诚,所以我将避免进行推荐。 只需选择最适合您的一个即可。
不,数据集不算数。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文