473,416 Members | 1,846 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,416 software developers and data experts.

Question on datareader and connection

Is it possible to open more than 1 datareader / dataadapter on one
connection ?

Is it possible to duplicate / clone connection ?
Nov 23 '05 #1
6 1928
Hi,

Yes. Here are some examples

http://www.vb-tips.com/default.aspx?...7-7bc3068aca2c

http://www.vb-tips.com/default.aspx?...e-e8335682ad3a

Ken
-------------------
"Kalim Julia" <ka*********@gmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Is it possible to open more than 1 datareader / dataadapter on one
connection ?

Is it possible to duplicate / clone connection ?

Nov 23 '05 #2
Kalim Julia,

At least thru VS2003, you can have only 1 datareader per connection.

Kerry Moorman
"Kalim Julia" wrote:
Is it possible to open more than 1 datareader / dataadapter on one
connection ?

Is it possible to duplicate / clone connection ?

Nov 23 '05 #3
No ( .NET 2003 ) for 2005 is am not sure :-|

that is why it is verry important to close the datareader object if you are
ready with it to make the connection availlable again

in fact you can`t issue anny other commands on a connection while a
datareader object is active on that connection the only command you can
perform on a connection actively serving a datareader is the Close method
Is it possible to duplicate / clone connection ? Yes

regrds

Michel Posseth [MCP]

"Kalim Julia" <ka*********@gmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl... Is it possible to open more than 1 datareader / dataadapter on one
connection ?

Is it possible to duplicate / clone connection ?

Nov 23 '05 #4
i have checked the 2005 reference and did not found other info , so it seems
that the below info is also valid for 2005
http://msdn.microsoft.com/library/de...datareader.asp
regards

Michel Posseth [MCP]
"Kalim Julia" <ka*********@gmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Is it possible to open more than 1 datareader / dataadapter on one
connection ?

Is it possible to duplicate / clone connection ?

Nov 23 '05 #5
There is also MARS

http://msdn2.microsoft.com/en-us/library/ms131686.aspx

Greg

"m.posseth" <mi*****@nohausystems.nl> wrote in message
news:en**************@tk2msftngp13.phx.gbl...
i have checked the 2005 reference and did not found other info , so it
seems that the below info is also valid for 2005
http://msdn.microsoft.com/library/de...datareader.asp
regards

Michel Posseth [MCP]
"Kalim Julia" <ka*********@gmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Is it possible to open more than 1 datareader / dataadapter on one
connection ?

Is it possible to duplicate / clone connection ?


Nov 23 '05 #6
Yep good one ,

simular thing is also possible with SQL 2000 ( multiple resultsets ) by
just writing stored procedures and seperating the sql with a ; now with the
datareader you can use next result to get the folowing resultset

However still....... executing multiple data readers on one connection is
not possible why would someone use a datareader instead of a dataset /
datatable ? well the speed ...as a datareader is much faster if you are
only retrieving data for display purposes .

So the answer is NO you can`t use multiple data readers on a connection ,
however there are workarounds

1. go to a disconected architecture ( much slower )
2. create the datareader`s on there own connection object ( requires some
extra coding from your side )
3. use multiple resultsets
etc etc

regards

Michel Posseth [MCP]



"Greg Burns" <bl*******@newsgroups.nospam> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
There is also MARS

http://msdn2.microsoft.com/en-us/library/ms131686.aspx

Greg

"m.posseth" <mi*****@nohausystems.nl> wrote in message
news:en**************@tk2msftngp13.phx.gbl...
i have checked the 2005 reference and did not found other info , so it
seems that the below info is also valid for 2005
http://msdn.microsoft.com/library/de...datareader.asp
regards

Michel Posseth [MCP]
"Kalim Julia" <ka*********@gmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Is it possible to open more than 1 datareader / dataadapter on one
connection ?

Is it possible to duplicate / clone connection ?



Nov 23 '05 #7

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...
6
by: Ravi | last post by:
Hi, I am not able to understand why a datareader needs a connection to the DB all the time. Here is what I tried. Sqlcommand cmd = ("select * from table1",con) // where con is the connection...
4
by: Maziar Aflatoun | last post by:
Hi everyone, I am working on the 'Delete' section of my program. What I need to do is query my database and for every ID that it finds I want to remove a file+ID.jpg from my file folder and...
4
by: James Radke | last post by:
Hello, I am looking for guidance on best practices to incorporate effective and complete error handling in an application written in VB.NET. If I have the following function in a class module...
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,...
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...
20
by: fniles | last post by:
I am using VB.NET 2003, SQL 2000, and SqlDataReader. As I read data from tblA, I want to populate tblB. I use SQLDataReader for both tables. I do not use thread. When I ExecuteReader on tblB, I...
10
by: jimmy | last post by:
Hi again, sorry for posting two questions so close together but im working on a school project which is due in soon and running into some difficulties implementing the database parts. I have the...
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: 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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.