How can you clean up objects holding resources from within
the code?

Answers were Sorted based on User's Feedback



How can you clean up objects holding resources from within the code? ..

Answer / ramesh

We can clean up object holding resources by using dispose()
method. Example
DataSet DS=new DataSet()

DS.Dispose()

Is This Answer Correct ?    5 Yes 1 No

How can you clean up objects holding resources from within the code? ..

Answer / mohan kumar e.

We can cleanup objects by implementing IDisposable
interface and providing the implementation for Dispose
method.

Is This Answer Correct ?    3 Yes 1 No

How can you clean up objects holding resources from within the code? ..

Answer / nagasaichand

2 PROCEDURES FORT THIS:
1)Make that value of object as null once the scope is finished.
2)use dispose(); method

Is This Answer Correct ?    1 Yes 0 No

How can you clean up objects holding resources from within the code? ..

Answer / tarun singla

Easiest way is to make the value of that object as null,
once the scope of that object is over. We generally do this
in the 'finally' section of the code.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Sharp Interview Questions

What are three test cases you should go through in unit testing?

1 Answers   Siebel Systems, Wipro,


i have a question which is quite simple but yet complicated for me my question is why do we use void, if it does not return anything to the compiler? if it is used for normal display it can also be done by what is called Console.Write() or Consol.WriteLine() and if i do not use void with my method then my compiler throws me an error. if i return a value say integer then i write public int fun() display of the result can also be done here then why is it so necessary to use void with a function and why so compiler throw us an error if v don't use void return type?

2 Answers  


Is xml tags are case sensitive?

0 Answers  


Is goto statement supported in C#? How about Java?

2 Answers  


What is an int in c#?

0 Answers  






What is the difference between values and reference types?

0 Answers   Alcatel-Lucent,


What is the difference between int and int in c#?

0 Answers  


Why static variables are used?

0 Answers  


Is c# code is managed or unmanaged code?

0 Answers  


How many bytes is an int?

0 Answers  


What is data annotation in c#?

0 Answers  


Difference between multi-level and multiple inheritance?

4 Answers   Microsoft,


Categories