Solved

ASP.NET - how to have multiple data readers in same routine

Posted on 2007-11-20
1
286 Views
Last Modified: 2008-02-01
I'm working on an ASP.NET/vbscript project and I have 3 sections of data on a form, each with a different datasource declared in the Page_Load. The problem I'm running into is that the first declaration (opening and filling SqlConnection, SqlCommand, SqlDataReader) works fine, but when I try to pull data from the 2nd SqlDataReader, I get an error message saying "Invalid attempt to read when no data is present". The sql command it is using to fill the reader is valid and works just fine. When I remove the code for the first datareader, the second one works perfectly fine....it just seems that when there are two declared and opened in the same routine, the second fails. Is there a way to have multiple datareaders in the same routine (they are named differently)?
0
Comment
Question by:wppiexperts
1 Comment
 
LVL 7

Accepted Solution

by:
nisarkhan earned 50 total points
Comment Utility
you use the

dr.NextResult();
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now