private void Dogovor_Load(object sender, EventArgs e) { this.WindowState = FormWindowState.Maximized; textBox1.Focus(); DataSet3 _dataset = new DataSet3(); OleDbCommand command3 = new OleDbCommand(); command3.Connection = conn; command3.CommandText = "Select * from Komintent order by Komintent asc"; OleDbDataAdapter DatAd = new OleDbDataAdapter(new OleDbCommand(command3.CommandText, conn)); try { conn.Open(); command3.ExecuteNonQuery();
DatAd.Fill(_dataset, "Komintent");
comboBox3.Items.Add("[Site]"); comboBox3.DataSource = _dataset.Tables["Komintent"]; comboBox3.DisplayMember = "Komintent"; comboBox3.ValueMember = "ID"; comboBox3.SelectedIndex = comboBox3.Items.Count - 1; } finally { conn.Close(); } }