Reusing objects

csharp United States
  • 17 years ago

    Alright, Im new to this guys, and I have really tried to find this out on my own with no luck. Here is my question,
    how do you reuse objects in c#? For instance, say Im using the datareader class in a function twice. But I completely finish with it before I use it in a second occurence. In vb I use to do this quite a bit by setting the object to nothing, and then just recreating a new instance of it. Is this possible in c#, it seems like it would have to be, c# rocks thus far. Thanks for dealing with my newbie question, I really appreciate it.


    Ryan

  • 17 years ago

    You can do that as many times as you want.




Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Engineers are all basically high-functioning autistics who have no idea how normal people do stuff.” - Cory Doctorow