c# - Refresh datagridview win forms after updating the database from a child form -


how refresh datagridview after making changes on database form, after closing child form tried refresh datagridview click event it's not working, have use dataset ?

            //create oledbdataadapter execute query             dadapter = new oledbdataadapter(gquery, connstring);              //create command builder             cbuilder = new oledbcommandbuilder(dadapter);              //create datatable hold query results             dtable = new datatable();              //fill datatable             dadapter.fill(dtable);               //bindingsource sync datatable , datagridview             bsource = new bindingsource();              //set bindingsource datasource             bsource.datasource = dtable;               //set datagridview datasource             datagridview1.datasource = bsource;      private void button_refresh_click(object sender, eventargs e)     {          datagridview1.datasource = bsource;         datagridview1.refresh();       } 

help me, please in advance

add

datagridview1.update(); 

it solve problem.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -