使用WPF应用程序连接到数据库 [英] Connecting to a database using a WPF application

查看:625
本文介绍了使用WPF应用程序连接到数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开始进入WPF不久之前。

由于我在学习MVVM的阶段,我使用 THIS 教程。

I've started getting into WPF not so long ago.
As I'm in the stage of learning MVVM, I'm using THIS tutorial.

按照这个教程,我现在有一个涉及产品的基本项目。

接下来要做的是学习如何连接到数据库并存储/检索信息。

Following that tutorial I now have a basic project that involves products.
The next thing I want to do, is learn how to connect to a database and store/retrieve information from it.

我的问题是,连接到数据库的可用方法是什么?

My question is, what are the available ways to connect to a database? what is the best, efficient way to do it?

此外,WPF应用程序可以连接到托管的mysql数据库(用于网站的数据库) )?

Also, can WPF applications connect to an hosted mysql database (the ones used for websites)?

我使用的是VS2012,如果这有什么区别。

I'm using VS2012 if that makes any difference.

不要使用我的新手!我还是一个初学者!
提前谢谢!

Excuse my newbie-ness! I'm still just a beginner! Thank you in advance!

推荐答案

检查: EF code first with oracle,mysql,

Check this: EF code first with oracle, mysql, etc.

最后,有一个示例的下载链接。

At the end, there is download link for a sample.

至于WPF,我建议阅读一些教程,如果你不熟悉它。搜索WPF和EF一起将导致很多有用的教程和博客等等。
但是我会建议使用Entityframework和代码优先方法。

As for WPF, i would recommend to read some tutorials if you´re not familiar with it. Searching for WPF and EF together will lead to a lot of more or less helpful tutorials and blogs, etc. But i would recommend playing around with the Entityframework and the code-first approach first.

这篇关于使用WPF应用程序连接到数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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