473,387 Members | 3,787 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

DataReader Problem

Hi,

Problem: Return ArrayList where Values are Added using DataReader.

Note: My Data Reader returns M Columns and N Rows

I am using DataReader in Data Access layer. I want to return this result to
Business Layer. But, considering performace and Efficiency, I have to Close
the DataReader Connection.

If I return this Datareader, again I need to open connection in Business
Layer, which is not good.

I tryinh to use ArrayList to return. But as of I know, we cant create Muti
Dimentional Array List

I really appreciate your Help......

Jul 21 '05 #1
1 1379
Is there something wrong with using a DataTable? This is the client side
storage that ADO.NET uses. You could use a DataAdapter and use the fill
command to fill up the datatable for you but you will take on the overhead
of a dataset and you may not need that. Otherwise just iterate through the
datareader and create the datatable on the fly. That's what the dataadapter
would do anyhow.

Chris

"VIJAY KUMAR" <VI********@discussions.microsoft.com> wrote in message
news:D8**********************************@microsof t.com...
Hi,

Problem: Return ArrayList where Values are Added using DataReader.

Note: My Data Reader returns M Columns and N Rows

I am using DataReader in Data Access layer. I want to return this result
to
Business Layer. But, considering performace and Efficiency, I have to
Close
the DataReader Connection.

If I return this Datareader, again I need to open connection in Business
Layer, which is not good.

I tryinh to use ArrayList to return. But as of I know, we cant create
Muti
Dimentional Array List

I really appreciate your Help......

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Yasutaka Ito | last post by:
Hi, My friend had a little confusion about the working of DataReader after reading an article from MSDN. Following is a message from him... <!-- Message starts --> I was going thru DataReader...
4
by: VB Programmer | last post by:
I have a function that returns a datareader. The problem is that in the function's FINALLY I close the datareader and set it to nothing. But, BEFORE the Finally I "Return" the datareader (in the...
12
by: Thomas Scheiderich | last post by:
I have 2 dropdowns that are exactly the same and I don't want to re-read for each. Is there a way to do something like below where I read the data, bind to depCity1 and then bind to destCity2. ...
20
by: Mark | last post by:
Hi all, quick question , a DataView is memory resident "view" of data in a data table therefore once populated you can close the connection to the database. Garbage collection can then be used to...
5
by: robecflo | last post by:
Hi Forum, i have a problem, hope somebody can give me ideas. I'm developing with windows forms and vb.net, and oracle as a database. At this moment i have a table called amortizaciones, this table...
17
by: Alan Silver | last post by:
Hello, I have a generic method in a utility class that grabs an sqldatareader and returns it. Due to the fact that (AFAIK), you can't close the database connection before you've read the data,...
3
by: Carlos Lozano | last post by:
Hello, I am having a problem getting the selectedValue from a dropdownlist that is populated with a dataReader and just can't see the problem. I did the following: dim dr as DataReader dr...
7
by: Diffident | last post by:
Hello All, I would like to use DataReader based accessing in my Data Access Layer (DAL). What is considered to be a best practice while returning from a DAL method that executes a query and...
1
by: Steve | last post by:
Hi, I currently display all the data on a website using tableadaptors and objectdatasources. Would it be significantly faster if I was to display the data by writing the code for a datareader...
3
by: Johnny Jörgensen | last post by:
I've got an error that I simply cannot locate: I've got a form in which I use a datareader object to read information from a db. After the read, I close the reader and I dispose of both the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.