コード例 #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;
        }
コード例 #2
0
        private void ListBoxDatabaseNames_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (listBoxDatabaseNames.DataSource != null)
            {
                var tableNames = serverOperations.TableNames(listBoxDatabaseNames.Text);

                if (tableNames.Count == 0)
                {
                    tableNames.Add("(none)");
                }
                listBoxTableNames.DataSource = tableNames;
            }
        }