Click here to Skip to main content
15,888,022 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I know this question has been asked multiple times.. But I m little confused with all the diff answers i found in web.

Why connected architecture is called connected architecture in ADO.NET ?

Why disconnected architecture is called disconnected architecture in ADO.NET ?

I know, Connected means read-only, forward-only etc... and disconnected means you can work offline with data.

But my questions are -

1. Is there any difference in # of hits to database?
2. In both cases, when the connection to DB is opened and closed?
3. Why do we have to use Connection.Close() in disconnected architecture when it gets the data and disconnects the connection?Am i getting confused b/w Close & Disconnect?


Please help me in clarifying these doubts... I just want to go in and see what's happening exactly.

Thank you.
Posted
Updated 10-Sep-18 3:59am

1 solution

1. There is no difference in # of hits, as no of hits depends upon how you have coded your program, its not about what type of connection you are using.
But somewhere in disconnected mode you can manage less # of hits for each db connection made.
2. Its true that in both cases DB is opened and closed, but in connected environment user occupy the connection until he finishes all his queries which slow down the network, in disconnected you fetch the data and close the connection so its free for other users.
3. When you request to open a connection with db server, your connection get opened and an entry is made in connection pool, until you will not close the connection, it remains open in pool, so to free the source you need to close it. Disconnect is not closing the connection.
 
Share this answer
 
Comments
bpc1989 2-Feb-15 7:29am    
Nilendra,

Thanks for the clarification.

It means unless we don't call DBConnection.Close(), the resource is occupied irrespective of connected or disconnected arch.
But, in disconnected, we have the facility of closing the connection because we get the data into a DataSet.
Whereas in connected, we won't be able to close the connection since it reads directly from DB.

Is my understanding correct?
Nilendra Nath 3-Feb-15 1:58am    
Hi,

Actually in disconnected mode data adapter manages to connect and disconnect with db. So no need to manually close the connection any time.
You can have a look in following link:

http://dotnethearts.blogspot.in/2013/05/connected-and-disconnected-mode-in.html

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900