Click here to Skip to main content
15,908,775 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionFailed to access IIS Metabase. Pin
MinhajuddinK24-Mar-07 22:01
MinhajuddinK24-Mar-07 22:01 
QuestionProblem Pin
MHASSANF24-Mar-07 21:14
MHASSANF24-Mar-07 21:14 
AnswerRe: Problem Pin
Bassam Saoud25-Mar-07 1:43
Bassam Saoud25-Mar-07 1:43 
QuestionadRotator control Pin
raj@code24-Mar-07 19:58
raj@code24-Mar-07 19:58 
AnswerRe: adRotator control Pin
Tamimi - Code25-Mar-07 0:51
Tamimi - Code25-Mar-07 0:51 
GeneralRe: adRotator control Pin
raj@code25-Mar-07 2:14
raj@code25-Mar-07 2:14 
QuestionAsp.net and Webfocus reporting Pin
Mohamed Arif24-Mar-07 17:30
Mohamed Arif24-Mar-07 17:30 
QuestionNested Query Results (DataReader woes) Pin
GregStevens24-Mar-07 14:03
GregStevens24-Mar-07 14:03 
I am connecting to an Oracle database using an OleDbConnection. I am using DataReader objects to get query results. However, this limits me to only having one reader open at a time, which is a problem for one of the operations I am doing.

I have a table with hierarhical data (only 3 levels deep) that I would like to parse through in a depth-first search. Each row in the table in the database has a Name and a ParentName, and I'm doing something like this:
oCmd1 = New OleDbCommand( "Select Name from tblTree where parentName='_top'", oCxn )
oRdr1 = oCmd1.ExecuteReader()

While oRdr1.Read()
     sName1 = oRdr1("Name")
     oCmd2 = New OleDbCommand( "Select Name from tblTree where parentName='" & sName1 & "'", oCxn )
     oRdr2 = oCmd2.ExecuteReader()

     While oRdr2.Read()
         '  do the third level, you get the idea
     End While
     oRdr2.Close()

End While
oRdr1.Close()

The problem is, it won't let me use oRdr2 while oRdr1 is open; and I can't close oRdr1 because it is still in the middle of cycling through the top-level items.

SO, my question is this: What is the PREFERRED way of dealing with this?

The options seem to be:

1) create a new DB connection for each level in the hierarchy
2) move to a different kind of object (DataSet?), instead of a DataReader
3) ??????.... some other option I haven't thought of?

I don't know which approach would be best, or if there are other approaches I'm not thinking of. Any help or advice is greatly appreciated.

Also, I apologize if this question would be better suited to a different forum. Please just let me know, and I'll take it there.

Thanks!
--- Greg Stevens
AnswerRe: Nested Query Results (DataReader woes) Pin
kubben24-Mar-07 14:13
kubben24-Mar-07 14:13 
GeneralRe: Nested Query Results (DataReader woes) Pin
GregStevens24-Mar-07 14:22
GregStevens24-Mar-07 14:22 
GeneralRe: Nested Query Results (DataReader woes) Pin
kubben24-Mar-07 14:36
kubben24-Mar-07 14:36 
GeneralRe: Nested Query Results (DataReader woes) Pin
GregStevens24-Mar-07 15:40
GregStevens24-Mar-07 15:40 
AnswerRe: Nested Query Results (DataReader woes) Pin
Jesse Squire25-Mar-07 1:35
Jesse Squire25-Mar-07 1:35 
QuestionArrayList Resetting When Adding Form Controls Pin
redfish3424-Mar-07 9:01
redfish3424-Mar-07 9:01 
Questiondatagrid sorting Pin
vsk84200524-Mar-07 8:24
vsk84200524-Mar-07 8:24 
AnswerRe: datagrid sorting Pin
kubben24-Mar-07 13:59
kubben24-Mar-07 13:59 
AnswerRe: datagrid sorting Pin
Rahithi24-Mar-07 19:52
Rahithi24-Mar-07 19:52 
GeneralRe: datagrid sorting Pin
siddisagar25-Mar-07 18:40
siddisagar25-Mar-07 18:40 
QuestionDeployment of asp pages on IIS Pin
MinhajuddinK24-Mar-07 7:34
MinhajuddinK24-Mar-07 7:34 
AnswerRe: Deployment of asp pages on IIS Pin
Christian Graus24-Mar-07 7:40
protectorChristian Graus24-Mar-07 7:40 
QuestionRe: Deployment of asp pages on IIS [modified] Pin
MinhajuddinK24-Mar-07 7:46
MinhajuddinK24-Mar-07 7:46 
GeneralRe: Deployment of asp pages on IIS Pin
MinhajuddinK24-Mar-07 8:09
MinhajuddinK24-Mar-07 8:09 
AnswerRe: Deployment of asp pages on IIS Pin
GregStevens25-Mar-07 16:42
GregStevens25-Mar-07 16:42 
QuestionRe: Deployment of asp pages on IIS Pin
MinhajuddinK25-Mar-07 17:05
MinhajuddinK25-Mar-07 17:05 
QuestionPassing windows authentication between different sites [modified] Pin
vaibhav_vartak24-Mar-07 5:43
vaibhav_vartak24-Mar-07 5:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.