private void frmpractice1_Load(object sender, EventArgs e) { dataGridView1.DataSource = ConnectionClass.Selectcommand("Select DISTINCT Invoice_No,Customer_Name,Time from tblAIMode "); dataGridView1.RowsAdded += new DataGridViewRowsAddedEventHandler(dataGridView1_RowsAdded); timer1.Interval = 5000; timer1.Tick += new EventHandler(UpdateDataGridView); timer1.Start(); } private void UpdateDataGridView(object sender, EventArgs e) { dataGridView1.DataSource = ConnectionClass.Selectcommand("Select DISTINCT Invoice_No,Customer_Name,Time from tblAIMode "); } private void dataGridView1_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e) { MessageBox.Show("New Row added"); dataGridView1.RowsAdded -= new DataGridViewRowsAddedEventHandler(dataGridView1_RowsAdded); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)