Solved

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

Posted on 2007-11-20
1
300 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 7

Accepted Solution

by:
nisarkhan earned 50 total points
ID: 20322672
you use the

dr.NextResult();
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Code works but breaks when I add one section 4 35
How to filter by key press ? 6 66
Asp.Net Session Question 2 49
Difference between Highcharts and Mapbox 10 45
One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

751 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