Beispiel #1
0
        public Form1()
        {
            InitializeComponent();                  // Initialize form components

            dataBase = new MySQLConnection();       // Create database connection

            fillStates();                           // Fill state drop box

            // Populate Categories Lists
            string qStr = "SELECT name FROM Categories";
            List<string> qResults = new List<string>();                 // Query must return list, even if we know there will only be one item
            qResults = dataBase.SQLSELECTExec(qStr, "name");
            qResults.Sort();                                            // Sort query list
            qResults = qResults.Distinct().ToList();
            foreach(string item in qResults)
            {
                listBoxCategoryDem.Items.Add(item);
                listBoxCategorySearch.Items.Add(item);
            }

            // Populate Attributes List
            qStr = "SELECT DISTINCT name FROM Attributes";
            qResults = dataBase.SQLSELECTExec(qStr, "name");
            qResults.Sort();
            listBoxAttributes.Items.AddRange(qResults.ToArray());
        }
Beispiel #2
0
        public Form1()
        {
            InitializeComponent();                  // Initialize form components

            fillStates();                           // Fill state drop box

            dataBase = new MySQLConnection();       // Create database connection
        }
Beispiel #3
0
        public Form1()
        {
            InitializeComponent();                  // Initialize form components

            fillStates();                           // Fill state drop box

            dataBase = new MySQLConnection();       // Create database connection

            // Populate Categories List
            string        qStr     = "SELECT name FROM Categories";
            List <string> qResults = new List <string>();                 // Query must return list, even if we know there will only be one item

            qResults = dataBase.SQLSELECTExec(qStr, "name");
            qResults.Sort();                                            // Sort query list
            qResults = qResults.Distinct().ToList();
            foreach (string item in qResults)
            {
                listBoxCategory.Items.Add(item);
            }
        }