>>>>I have a Data Access class in which I have ExecuteQuery, ExecuteNonQuery, ExecuteReader and ExecuteScalar methods. All of these call a private _GetConnection method which returns a SqlConnection object.
>>>>
>>>>The problem is that the connection object is never exposed to the class which uses this class. So how do I close the connection? I was thinking of creating a private field level variable that would hold the connection, but I'm not sure if this is the best way.
>>>>
>>>>Anyone wanna point me in the right direction?
>>>I don't know if this is possible
>>>
>>>using _GetConnection()
>>>
>>>end using
>>
>>
>>Huh?
>
>In other words, if you use this syntax, the connection object is automatically closed.
Ok, I see. But I'm not sure how to use it in my class. Can you elaborate a bit?
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people