使用 Microsoft Expression Blend4 进行 WPF 应用程序的数据绑定教程
我是 Microsoft Expression Blend 4 和 WPF 的新手。我没有找到有关 XML 数据绑定和数据库数据绑定的教程。如果您有资源,请发布。
感谢和问候 戒日
I am new to to Microsoft Expression Blend 4 and WPF. I am not finding tutorials about Data Binding for XML and also for DBs. If you have any resources, please post the it.
Thanks and regards
Harsha
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我最大的建议是研究实体框架。
如果您已经设计了数据库,则可以自动生成代码来访问数据库并进行数据绑定。您可以启用延迟加载,以便在您首次访问该数据之前不会从数据库加载数据。您可以随意修改数据(并且它在内存中进行),然后您可以选择何时通过调用 Save() 方法将这些更改保存到数据库,或者您可以取消所做的更改并将它们恢复回来更改之前数据库中的内容。
它非常光滑,我绝对建议您尝试一下。
我可能建议查看基本教程和示例项目,看看您能做什么。
这是一个起点: http://msdn.microsoft.com/en-us /library/bb386876.aspx
My biggest recommendation is looking into Entity Framework.
If you've already got your database designed, you can auto generate code that lets you access and databind to your db. You can enable lazy loading so data doesn't get loaded from the database until you first access that data. You modify your data all you like (and it does it in memory), then you can choose when to persist those changes to the db by calling a Save() method, or you could cancel the changes you've made and revert them back to what was in the db before you made changes.
It's pretty slick and I definately recommend giving it a try.
I might suggest looking at a basic tutorial and a sample project to see what all you can do.
Here's a starting point: http://msdn.microsoft.com/en-us/library/bb386876.aspx