在Silverlight中从WCF获取数据表 [英] Get Datatable from WCF in Silverlight

查看:73
本文介绍了在Silverlight中从WCF获取数据表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我是SilverLight开发的新手,我需要从我的应用程序访问SQL数据库,因为我正在使用WCF服务,当我返回预定义类的List类型时,它工作正常属性。

但是现在我需要来自SQL查询的数据并需要填充DataGrid,查询中的select列会因用户选择而异,所以我不能使用预定义的类。我尝试在运行时使用Reflection将属性添加到类中但没有用。

请帮我解决这个问题,如果可能的话请用一个例子来解释。



提前谢谢。

解决方案

看看下面的链接。它几乎涵盖了你想做的一切。



http://stackoverflow.com/questions/17418528/bind-list-with-dynamically-returned-columns

Hello,
I am new to SilverLight development, I need access SQL Database from my application for that I am using WCF service and it's working fine when I return a List type of a predefined class and properties.
But now I need data from a SQL Query and need to fill the DataGrid, the select columns in the query will vary based on the user selection, so I can not use a predefined class. I have tried adding the properties to the class at runtime using Reflections but of no use.
Please help me to solve this problem, if possible please explain with an example.

Thanks in advance.

解决方案

Have a look at below link. It has almost everything what you are trying to do.

http://stackoverflow.com/questions/17418528/bind-list-with-dynamically-returned-columns


这篇关于在Silverlight中从WCF获取数据表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆