如何连接数据库和Windows窗体应用程序 [英] how to connect database and a windows forms app

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

问题描述

大家好



我是一名初级程序员,我在大约2年内没有触及代码,现在我被要求为客户创建一个简单的应用程序允许他们从数据库中检索数据并以windows形式显示,我不能相信我忘了怎么做但是我卡住了。



我有一个数据库在phpmyadmin上称为客户,其中有一个名为astel的表。

我有我的Windows窗体应用程序,但我卡在连接字符串上,我怎么能让应用程序从中检索数据我的数据库和表格,并在应用程序中显示,如果有人有一个关于使用Windows应用程序和数据库的教程,最好在phpmyadmin,这将有助于很多



任何帮助表示赞赏

谢谢。

Hi All

Im a junior programmer and I have not touched code in about 2 years, and now ive been asked to create a simple app for a client to allow them to retrieve data from a database and display it in a windows form, I cant believe I forgot how to do this even but im stuck.

I got a database on phpmyadmin called "clients" with a table in it called "astel".
Ive got my windows form app, but im stuck on the connection string, how can i get the app to retrieve the data from my database and table and display it in the app, if anyone has a tutorial on working with windows apps and databases preferably in phpmyadmin that would help alot

any help is appreciated
thanks.

推荐答案

简答道是:使用ADO.NET:

http://en.wikipedia.org/wiki/ADO.NET [ ^ ],

http://msdn.microsoft.com/en-us/library/aa286484.aspx [ ^ ]。



这篇优秀而简单的CodeProject文章可以帮助您立即开始: 为初学者使用ADO.NET [ ^ ]。



-SA
Short answer is: use ADO.NET:
http://en.wikipedia.org/wiki/ADO.NET[^],
http://msdn.microsoft.com/en-us/library/aa286484.aspx[^].

This excellent and simple CodeProject article can help you to get started in no time: Using ADO.NET for beginners[^].

—SA


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

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