/******************************************************************************** * Form1_Load() * On-Load the form will try to establish a connection to the database * 'CurrencyConversion'. Once it has established a connection, it will fill * the available input currency types and the output currency types. They will * be labeled by their currency codes and put in combo boxes or drop-downs. ********************************************************************************/ private void Form1_Load(object sender, EventArgs e) { try { objConnect = new DatabaseConnection(); objConnect.connection_string = Properties.Settings.Default.CurrenciesConnectionString; ; //The SQLtest command can be found in settings. But for reference here it is: //SELECT * FROM Currencies objConnect.Sql = Properties.Settings.Default.SQLtest; //Get the data from the connection statement above. ds = objConnect.GetConnection; //Find the stopping point for the iterators. MaxRows = ds.Tables[0].Rows.Count; //Fill the drop-downs with currency codes. FillInputCurrencyComboBox(); FillOutputCurrencyComboBox(); } catch (Exception err) { MessageBox.Show(err.Message); } }