Ejemplo n.º 1
0
 private void initialize_mysql_connection()
 {
     init_con = new MysqlC();
     con = new MySqlConnection(init_con.temp_connection_string());
 }
Ejemplo n.º 2
0
 private void fill_combobox_country()
 {
     MysqlC init_con = new MysqlC();
     MySqlConnection con = new MySqlConnection(init_con.temp_connection_string());
     String query = "SELECT * FROM country WHERE language = '"+ Thread.CurrentThread.CurrentUICulture.Name.Substring(0,2)+"';";
     MySqlCommand cmd = new MySqlCommand(query, con);
     MySqlDataReader reader;
     try
     {
         con.Open();
         reader = cmd.ExecuteReader();
         while (reader.Read())
         {
             string country_name = reader.GetString("country");
             Registration_comboBox_country.Items.Add(country_name);
         }
     }
     catch (Exception e)
     {
         logger.Error("RETRIVE_COUNTRY_FAILED: ", e);
     }
     finally
     {
         con.Close();
     }
 }