Ejemplo n.º 1
0
 //'''''''''''''''''''''''''''''''''
 //'' Combobox related functions '''
 //'''''''''''''''''''''''''''''''''
 internal static void LoadCombo(string Table, ComboBox combo, ref string field, ref string valueField)
 {
     modConnection.ExecuteSql("Select * From " + Table);
     combo.Items.Clear();
     //UPGRADE_WARNING: (2080) IsEmpty was upgraded to a comparison and has a new behavior. More Information: http://www.vbtonet.com/ewis/ewi2080.aspx
     if (!String.IsNullOrEmpty(valueField))
     {
         foreach (DataRow iteration_row in modConnection.rs.Tables[0].Rows)
         {
             combo.AddItem(Convert.ToString(iteration_row[field]));
             combo.SetItemData(combo.GetNewIndex(), Convert.ToInt32(iteration_row[valueField]));
         }
     }
     else
     {
         foreach (DataRow iteration_row_2 in modConnection.rs.Tables[0].Rows)
         {
             combo.AddItem(Convert.ToString(iteration_row_2[field]));
         }
     }
     //If strDefault <> Empty Then
     // combo = strDefault
     //End If
 }