Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old October 15th, 2007, 09:39 AM
Friend of Wrox
 
Join Date: Aug 2006
Location: Bangalore, Karnataka, India.
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Default datareader

is it necesary to close datareader instance or it is auto closed when got out of scope.

thanks......
__________________
thanks......
  #2 (permalink)  
Old October 15th, 2007, 10:19 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

It's closed when it's disposed off, which can be a little later than when it goes out of scope. Therefore, you should always Close them explicitly when possible, or wrap the Reader in a using block.

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
  #3 (permalink)  
Old October 17th, 2007, 07:05 AM
Friend of Wrox
 
Join Date: Aug 2006
Location: Bangalore, Karnataka, India.
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Default

thanks Imar
i am on third part of yours article series regarding architecture of webapplication present on your web site. i have few things to.ask.will ask just after completing all three,

thanks......


Similar Threads
Thread Thread Starter Forum Replies Last Post
regarding datareader adityamadisetty VB.NET 1 May 8th, 2006 09:31 AM
DataReader truongnnhat ASP.NET 1.0 and 1.1 Basics 2 February 18th, 2005 12:41 AM
Datareader NitinJoshi ADO.NET 4 January 31st, 2005 08:34 AM
datareader surapongmax ADO.NET 1 October 8th, 2004 07:53 AM
DataReader cjcd BOOK: Beginning ASP.NET 1.0 2 March 21st, 2004 01:06 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.