Hi I have 2 Form Form1 and Form2
Form1 have a table and there is my records and there is a Void for refresh the table in the Form1.
Form2 is my insert form I am insertig data to sqlserver.I wantto that When after i save the record in Form2 to run Form1 Refresh void.(when Form1,Form2 opened)
thanks.
Form2 will have to have a reference to the instance of Form1. You can pass this reference to Form2 when the insert button is clicked:
Next on Form2 you can access Form1 like this:
In Form1, when you open Form2, attach to Form2
OnClose/Closed
event, or a customSave
event, which when raised, refreshes the table in form 1.Adjust the construct for Form2 so it takes an extra parameter, like this:
You should consider however looking up on Interfaces so you can seperate concerns. Interfaces are useful for many things!
try this to call method from another form :