Example #1
0
        private void cmdLoadDatabaseNames_Click(object sender, EventArgs e)
        {
            lstDatabaseNames.DataSource = _operations.DatabaseNames();

            /*
             * If Karen's computer there is a database NorthWindAzure
             */
            if (Environment.UserName == "PayneK")
            {
                var index = lstDatabaseNames.FindString("NorthWindAzure");

                if (index > -1)
                {
                    lstDatabaseNames.SelectedIndex = index;
                    lstTableNames.DataSource       = _operations.TableNames(lstDatabaseNames.Text);
                    index = lstTableNames.FindString("Orders");

                    if (index > -1)
                    {
                        lstTableNames.SelectedIndex = index;
                    }
                }
            }


            lstDatabaseNames.SelectedIndexChanged += LstDatabaseNames_SelectedIndexChanged;
        }
Example #2
0
        private void cmdDatabaseNames_Click(object sender, EventArgs e)
        {
            listBoxDatabaseNames.SelectedIndexChanged -= ListBoxDatabaseNames_SelectedIndexChanged;
            listBoxDatabaseNames.SelectedIndexChanged += ListBoxDatabaseNames_SelectedIndexChanged;

            listBoxDatabaseNames.DataSource = serverOperations.DatabaseNames();
        }