• Creator
  • #2262349

    Microsoft .Net And MySQL


    by ofentseboikanyo ·

    How do i populate Microsoft .Net combobox with information from MySQL database?

All Answers

  • Author
    • #2542182


      by ofentseboikanyo ·

      In reply to Microsoft .Net And MySQL


    • #2541878

      There’s a few ways to do that.

      by tony hopkinson ·

      In reply to Microsoft .Net And MySQL

      Assuming you have the Mysqlconnector installed.

      Look for on google, if you haven’t

      connection = new MySqlConnection(“server=myserver; user id = myuser; password = mypassword; datanase = mydatabase”)

      MySqlCommand command = connection.CreateCommand();
      command.commandtext = “Select Key,Value from mytable”;
      MySqlDataReader reader = command.Execute();
      While (
      comoboval = new comboval(reader[key],reader[value]);

      If you are only interested in the text you could forget the comboval class and just do
      , mycombo.items.add(reader[value]);

      If you aren’t creating an inflatable dartboard.

      They bash up the class and override the ToString() method return value.

      PS that msi file comes with a nice swadge of examples.

      PPS, this was off teh top of my head, so expect one or two syntax errors, probably Add instead of add for starters.

Viewing 1 reply thread