Please I have a problem
I have created a program deals with data base for ( cars showroom), I will illustrate the problem
Suppose form (A) has the connection & data grid and every think necessary, and form (B) which used for inserting cars for instance. When the insertion operation complete the data grid don't update but the actual data has been updated in the data base so I have to close the form (A) then run it again and after that the changes happened ( note : my program working but the data grid don't update immediately )
I must mention that I have use the object technique
So when I say open form (B) for insert
and in the form (B) after inserting (save button)
Form ptr= new B();
I have tried to solve this problem by using updeta(), refresh() , but it didn't work
A insertptr= new A();
// this function do the insert,delelteÖÖ.
Also I have do this , I created public function in form (A)
and in the load event for form (A)
public void loadfun()
this.sqlDataAdapter1.SelectCommand.CommandText = "SELECT * FROM CarSpecifications ORDER BY CarName,Class,Model,SpecificationId";
and in the code number 2 see above I have put
private void Cars_Showroom_Load(object sender, System.EventArgs e)
but unfortunately it didn't work, the strange is when I call it in the load it works, when I call it in anywhere form Form (A) it works, but when I call it from Form(B) it works but the update don't happen immediately I must restart the form or I must call that function (loadfun) from the form (A) which the function located.
A New_Specification = new New_Specification();
i hope that I could explain the problem very well so that u can help me
Note: I don't have any syntax error and I am very sure form code coz the program work properly .