tags:

views:

37

answers:

0

Hello all,

Well, as i mentioned, i am using an app_code file to handle my connections to the DB, using two public static functions. one for the SqlDataReader when using SQL and the other is XmlReader when using XML.

The thing is, in ExecuteReader i can write: return cmd.ExecuteReader (CommandBehavior.CloseConnection); and that will close the connection just after freeing the dataReader.

In XML i have to write: return cmd.ExecuteXmlReader(); so the connection is still open all the time....

How can i close the SqlConnection in the XmlReader function from the DBHelper file or the *.aspx.cs file???

Any one got an idea?