Using same object in many methods
Suppose i create an object and use it in say 3-4 methods.. If all the methods are called how does this work?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Ravi ShekharPosted May 4, 2013, 5:02 AM
After any use of every object must dispose.
Like globally you make an object of a class...
Class objClass;
in the first method....
objClass=new Class();
here do work with objClass
Now call objClass.Dispose();
as same as in second method again....
objClass=new Class();
here do work with objClass
Now call objClass.Dispose();
1
this is the best way to use.
regards,
ravi.
Please mark it as answer if it helped you.