G
Guest
given i have a class with a data reader function that returns a reader with a:
function fn_getUserInfo() as sqlDataReader
....
....
....
Return sqlcmd1.ExecuteReader(Data.CommandBehavior.CloseConnection)
end
and the following code for using this reader:
Dim lf As loginfunctions = New loginfunctions
Dim rdr As SqlDataReader = lf.fn_getUserInfo(Page.User.Identity.Name)
If rdr.HasRows Then
rdr.Read()
....
....
....
end
Do i need to close this reader at the end of execution or will it go away
after it goes out of scope?
Thanks
function fn_getUserInfo() as sqlDataReader
....
....
....
Return sqlcmd1.ExecuteReader(Data.CommandBehavior.CloseConnection)
end
and the following code for using this reader:
Dim lf As loginfunctions = New loginfunctions
Dim rdr As SqlDataReader = lf.fn_getUserInfo(Page.User.Identity.Name)
If rdr.HasRows Then
rdr.Read()
....
....
....
end
Do i need to close this reader at the end of execution or will it go away
after it goes out of scope?
Thanks