Groups | Blog | Home
all groups > asp.net > june 2004 >

asp.net : response.redirect and recordset/connection object?



nick
6/25/2004 10:58:08 PM
I have the following code in JScript. Should I close and release the
database objects
before run response.redirect("some url")? or will the response.redirect
automatically close the database object/connection like the end of asp
script?

.......
var cmd = Server.CreateObject("ADODB.Command")
var rs = Server.CreateObject("ADODB.Recordset")
cmd.ActiveConnection = conn
cmd.CommandText = strCmd
cmd.CommandType = adCmdStoredProc
rs.Open(cmd)

.......

response.redirect("some url")


Jeffrey Palermo [MCP]
6/26/2004 9:19:04 AM
Nick,
Yes, you should close out all objects when you don't need them anymore.
Don't expect or even wait for something else to clean up your variables.
Being proactive will make it a better application. By the way, this is an
ASP.NET newsgroup, not an ASP 3.0 newsgroup.

Best regards,
Jeffrey Palermo

[quoted text, click to view]

AddThis Social Bookmark Button