ADO  dotnet
  
asp.net hosting DotNet Hosting  eCommerce Hosting  SQL Server Hosting  ADO DotNet  ASP DotNet  DotNet Tutorials 
  
         
 

Your domain available ?
www.

BUY NOW
ASPNET 4
SQL SERVER HOSTING
SQL SERVER 2012 HOSTINGNew
DOTNETNUKE HOSTING
GET LISTED IN GOOGLE
30 DAY MONEY BACK
OUR PARTNERS
ASP NET TUTORIALS
WEB DESIGN TEMPLATES
TERMS
PRESS ROOM
CONTACT US




 

 

Multiple DataReaders with one connection object

To build multiple DataReaders with one connection object its important to close the DataReader before opening the new one.

'# Here gCon is a connection object

'# Build DataReader
tmpDataReader = daUtil.BuildDataReader(gCon, strSQL)
MyDataList1.DataSource = tmpDataReader
MyDataList1.DataBind()
'# Very important to close the DataReader
tmpDataReader.Close()

'# Now build the second DataReader
tmpDataReader = daUtil.BuildDataReader(gCon, strSQL2)
MyDataList2.DataSource = tmpDataReader
MyDataList2.DataBind()
tmpDataReader.Close()


You can also avoid getting the error "There is already an open DataReader associated with this Connection which must be closed first. " by using this technique.

Submitted By:
Gulshan Baryah
New Generation Technoloies Ltd
www.ngt.co.uk

 

 

 

 

 

 

 

Stacks of web space and bandwidth with all packages

ASP Hosting £6/Month


.net hosting

.NET Hosting £10/Month
400MB


Terms   Privacy

Copyright ©2002-2011 DotNet We Hosting UK, All rights reserved