private void button1_Click(object sender, EventArgs e) { Classes.Bus bus = new Classes.Bus(); DataTable data = new DataTable(); data = bus.GetPessangers(txtBusNo.Text); dataGridView1.DataSource = data; }
private void PessengerListForm_Load(object sender, EventArgs e) { Classes.Bus bus = new Classes.Bus(); DataTable data = new DataTable(); data = bus.GetPessangers(txtBusNo.Text); dataGridView1.DataSource = data; txtBusNo.Text = _busNo; button1.PerformClick(); }