[Visual studio] coupling to a MySQL database - Helena61/-bookshelf GitHub Wiki

  1. download to the MySQL-driver for .NET (https://www.mysql.com/products/connector/) -> msi-file
  2. install the msi-file
  3. Visual Studio :
  4. create your project.
  5. use configuration-file (menu: Project -> Properties -> Settings)
  6. Settings -> name = 'setting', type ='connection string', scope = 'application', value = .
  7. creates an entry in the App.config-file (see the name)
  8. 'Solution Explorer' -> References -> 'Add reference' -> MySQL.Data

Here name = Bookshelf.Properties.Settings.Setting

        static string dbConnection = ConfigurationManager.ConnectionStrings["Bookshelf.Properties.Settings.Setting"].ConnectionString;
        MySqlConnection conn = new MySqlConnection(dbConnection);

        MySqlCommand typeCommand;
        MySqlDataAdapter typeAdapter;
        DataTable typesTable;
        CurrencyManager manager;