protected override void OnCreateControl() { base.OnCreateControl(); Database db = new Database(); this.textBoxConnectionString.Text = db.ConnectionString; }
private void buttonGetData_Click(object sender, EventArgs e) { Database db = new Database(); db.ConnectionString = this.textBoxConnectionString.Text; viewCompanies = new ObjectListView(db.GetCustomers()); viewOrders = new ObjectListView(db.GetOrders()); this.comboBoxCustomers.DataSource = viewCompanies; this.comboBoxCustomers.DisplayMember = "Company"; this.comboBoxCustomers.ValueMember = "Id"; this.dataGridView.AutoGenerateColumns = false; this.dataGridView.DataSource = viewOrders; this.textBoxFilter.Text = ""; this.textBoxFilter.Enabled = true; }