/// <summary>The find object form_ shown.</summary> /// <param name="sender">The sender.</param> /// <param name="e">The e.</param> private void FindObjectForm_Shown(object sender, EventArgs e) { var collection = new AutoCompleteStringCollection(); try { UseWaitCursor = true; if (_databaseInspector.DbSchema == null) { _databaseInspector.LoadDatabaseDetails(); } foreach (DbModelTable table in _databaseInspector.DbSchema.Tables) { collection.Add(table.FullName); } foreach (DbModelView view in _databaseInspector.DbSchema.Views) { collection.Add(view.FullName); } } finally { UseWaitCursor = false; } cboObjects.AutoCompleteCustomSource = collection; }
private void FindObjectForm_Shown(object sender, EventArgs e) { _items.Clear(); try { UseWaitCursor = true; if (_databaseInspector.DbSchema == null) { _databaseInspector.LoadDatabaseDetails(); // And if it is still null (e.g. connection error) then bail out: if (_databaseInspector.DbSchema == null) { return; } } foreach (DbModelTable table in _databaseInspector.DbSchema.Tables) { var name = table.Schema; if (!String.IsNullOrEmpty(name)) { name += "."; } name += table.Name; _items.Add(name); } foreach (DbModelView view in _databaseInspector.DbSchema.Views) { _items.Add(view.FullName); } } finally { UseWaitCursor = false; } lstItems.DataSource = _items; txtSearchPattern.Focus(); }