C#/MySql 1: Installing
What you need to know before attempting to work with MySql via C# is a basic knowledge in database handling, such as creating databases and tables, inserting and reading records and altering records, and the basics of C#.
Now, before we get started you need three things.
Install MySql according to the guidelines on their homepage to set up a server. Create a user account so that we can logon later.
Install the connector. When it has been installed, open Data Source(ODBC) from the control panel. If you can't find it, search for Data Source and it should pop up.
Press add to add a new data source. Server and user/pass is the most important to fill.
It looks like this:
With this installed, open up your IDE and start a windows forms project.
We have to enable working with MySql in our project.
Add a reference to MySql.Data; Go to Project --> Add Reference and look up MySql.Data and select it.
Also include the MySql.Data namespace, like this:
Having done this, you ought to be ready to start working with MySql in C#!
Feel free to comment this article using a facebook profile.
I'm using facebook accounts for identification since even akismet couldn't handle all the spam I receive every day.