G
Guest
Hey
I would like to write a database class. Let's say it would work like this:
datareader GetDataReader(string sqlquery);
This would be static, so I could do this:
datareader dr = myclass.GetDataReader("SELECT * FROM table);
But in this function I would have an open connection how to close it ?
I return dr, does it create a new object or gives me a reffernce to existing
one ?
It's done like this : return dr; so ... ? Maybe you will give me some light
on this subject.
Jarod.Net
I would like to write a database class. Let's say it would work like this:
datareader GetDataReader(string sqlquery);
This would be static, so I could do this:
datareader dr = myclass.GetDataReader("SELECT * FROM table);
But in this function I would have an open connection how to close it ?
I return dr, does it create a new object or gives me a reffernce to existing
one ?
It's done like this : return dr; so ... ? Maybe you will give me some light
on this subject.
Jarod.Net