Click here to Skip to main content
15,917,320 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my Windows Form Application, there are two forms viz; MainForm(Parent Form) and ProductionDetails(Child Form) . Whenever I run the application the MainForm opens first. In the MainForm, there is a dataGridview1 is used for displaying Production data from Production table in DB and a button1 control to open ProductionDetails above MainForm.
Now, my query is that, whenever I insert a new row in Production table in DB, the dataGridview1 available in MainForm should be refreshed in the same time. Please help me in solving this problem.
Posted

1 solution

Hi,

I would ask you what have you tried so far. I think you should probably try something before you ask the question and then ask if you have any difficulties. Please remember that this is a community where issues faced are resolved and everyone gets benefited by different kinds of issues they face while developing something.

Anyway, as far as your question goes, have a static method in the parent form which gets called from the child form whenever you update any records.
If you want it to constantly update the DataGridView (depending upon your situation), use a timer along with a background worker to call the database and then update the DataGridView.

Hope this helps.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900