Data comparison between Datagrid and database

Asked

Viewed 177 times

0

Hello guys I’m with a doubt in my application, because in it runs a pocket pc(Collector) connected to mysql inserting in the product table(Idproduct, cod_barr, Description), and on the other side has an application with a datagridview displaying what is being inserted in the table by that pocket pc, before displaying on the grid I would like to check if I am not picking up an existing record or bringing only the record that is not yet listed on the grid

1 answer

0


I think you do not need to do this check, I believe it is much simpler to cancel and update the datasource of your dataGridView, as follows:

dataGridView.DataSource = null;
dataGridView.Update();
dataGridView.Refresh();

and then simply re-fill Datasource:

List<Produtos> objListProdutos = new List<Produtos>();
dataGridView.DataSource = objListProdutos;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.