4004 RIA 服务错误 - 远程数据库
最终能够使用 RIA 设置我的 silverlight 应用程序后,我调用以下代码从远程数据库获取 citie 对象列表:
_context = context;
var load =_context.Load(_context.GetCitiesQuery());
_cities = new ObservableCollection<City>(load.Entities);
我没有收到错误,但也没有数据。使用 fiddler 后,我确实看到得到如下所示的响应:
@GetCitiesResponsehttp://tempuri.org/@GetCitiesResult aDomainServices i)http://www.w3.org/2001/XMLSchema-instance^ 总数�^ RootResults b4http://schemas.datacontract.org/2004/07/Gymsport.Web_City_CityID�_CityName�Oelegem_PostCode�� _City_CityID�_CityName�Ranst_PostCode�� _City_CityID�_CityName�Emblem_PostCode�� _City_CityID�_CityName�Ranst_PostCode��
哪个是很多垃圾,但在字里行间你可以读到它返回了几个城市。 但由于某种原因,我的 silverlight 应用程序无法识别这些内容。
关于如何寻找解决方案有什么建议吗?
提前致谢。 格茨 时间
After finaly be abble to setup my silverlight app with RIA, I call the following code to get my list of citie objects from my remote database:
_context = context;
var load =_context.Load(_context.GetCitiesQuery());
_cities = new ObservableCollection<City>(load.Entities);
I get no errors, but also no data. After using fiddler I do see that I get a responce looking like this:
@GetCitiesResponsehttp://tempuri.org/@GetCitiesResult aDomainServices i)http://www.w3.org/2001/XMLSchema-instance^
TotalCount�^
RootResults b4http://schemas.datacontract.org/2004/07/Gymsport.Web_City_CityID�_CityName�Oelegem_PostCode�� _City_CityID�_CityName�Ranst_PostCode�� _City_CityID�_CityName�Emblem_PostCode�� _City_CityID�_CityName�Ranst_PostCode��
Which is a lot of rubbish, but between the lines you can read it returns a couple of cities.
But for some reason my silverlight app doens't pick up on those.
Any suggestions on how to look for a solution?
Thanks in advance.
Grtz
T
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决方案:
我必须使用 EntityList 对象将查询结果转换为可观察的集合。谢谢 Firefox ErrorConsole :)
Solution:
I had to work with the EntityList object to convert the result of the query to an observable collection. Thank you Firefox ErrorConsole :)