开发者

Few question about client application to be networked

开发者 https://www.devze.com 2022-12-24 18:32 出处:网络
I have made a registration program. Making use of mysql database. Can I still use the traditional programming for client applications. If I want to network it. Do I have to modify the codes a little
  1. I have made a registration program. Making use of mysql database. Can I still use the traditional programming for client applications. If I want to network it. Do I have to modify the codes a little in order to make it work?

-Please enlighten me, I'm just a beginner. I don't have a开发者_StackOverflowny idea on how this works. Do I have to install wampserver only in one computer?

I'm using visual studio 2008. Win forms to be exact.


There's really no difference between using a mySQL database and a SQL Server or Oracle database for Windows Forms programming.

To connect to your mySQL database during development, you will need to download and install the MySQL .Net Connector on your development PC. Once you've referenced the MySql.Data DLL in your WinForms project, you can then use the MySql database classes to retrieve data:

string MyConString = "SERVER=localhost;" +
    "DATABASE=mydatabase;" +
    "UID=testuser;" +
    "PASSWORD=testpassword;";
MySqlConnection connection = new MySqlConnection(MyConString);
MySqlCommand command = connection.CreateCommand();
MySqlDataReader Reader;
command.CommandText = "select * from databaseTable";
connection.Open();
Reader = command.ExecuteReader();

etc..

You will need to install mySQL server on a database server somewhere - one way to do this is indeed using wampServer (although it's a bit heavier than you really need - you definitely don't need Apache or PHP, although I guess phpMyAdmin is a good way to manage your mySQL database). Either way, you'll probably just want one central database on a single server, so you'd just install wamp there.

0

精彩评论

暂无评论...
验证码 换一张
取 消