I have a access database from where I am populating the datagridview on button click event. but what I exactly I want to add record of access database in datagridview when button is clicked. Means on 1st click 1 record should be add in datagridview, on 2nd click another record should be add and so on...
What modification I need to make in my code, please guide me
private void button1_Click(object sender, EventArgs e)
{
aCommand3 = new OleDbCommand("select * from batch_tbl", main_connection);
aAdapter3 = new OleDbDataAdapter(aCommand3);
ds3 = new DataSet();
aAdapter3.Fill(ds3, "app_info");
ds3.Tables[0].Constraints.Add("pk_bno", ds3.Tables[0].Columns[0], true);
int batch_count = ds3.Tables[0].Rows.Count;
dataGridView1.AutoGenerateColumns = true;
dataGridView1.DataSource = ds3.Tables[0];
}
Thank you everybody for any advice/suggestion