how to declare dataset in silverlight for windows phone7 using c#?

◇◆丶佛笑我妖孽 提交于 2019-12-22 01:32:33

问题


Please post the answer for how to declare dataset in silverlight for windows phone7 using c#?


回答1:


There is no support for datasets in WP7. You have to build your own datacollections. (For example you could use the ObservableCollection).

My suggestion would be to check the code samples on the MSDN page. (The WeatherForecast example uses webservices to retrieve data).

Also I would suggest to read some on the MVVM pattern. (MSDN Article)




回答2:


Instead of Dataset you should use ObservableCollection to store your data (which you have read from your WCF or RESTful webservice) and bind it to your ListBox.

To lean more about how to bind listboxes I would say: create an empty "WP7 Databound Application" and see the default implementation it has.

Here is a good video tutorial about "How to use webservices in WP7"



来源:https://stackoverflow.com/questions/6605912/how-to-declare-dataset-in-silverlight-for-windows-phone7-using-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!