Query about SQL Data Adapter [Resolved]

Posted by S.faizaan under VB.NET on 7/12/2011 | Points: 10 | Views : 2022 | Status : [Member] | Replies : 7
Hi...
is it necessary to open and close a sql connection for fetching data using a data adapter

Thanks in advance

Thanks & Regards,
Faizaan



Responses

Posted by: Lakn2 on: 7/12/2011 [Member] Starter | Points: 50

Up
0
Down

Resolved
no it's not required to open and close connection when you are using sql dataadapter because it is disconnected architecture.

Thanks&Regards
LakshmiNarayana Nalluri.

S.faizaan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vforvijay on: 7/12/2011 [Member] Starter | Points: 50

Up
0
Down

Resolved
hi....

While using DataSet and DataAdapter, you don't need to explicitly open the connection. DataAdapter automatically opens and closes the connection as and when required.

S.faizaan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: RaviRanjanKr on: 7/12/2011 [Member] Starter | Points: 50

Up
0
Down

Resolved
Its not depend up on data adapter. making connection operation is always came in existence whenever we required to connect our Client to server in order to exchange information for various purpose either it's in Connected or in Disconnected Environment.
its advised that when ever you open a connection you should close it when you done operation with them or just before to opening another connection. its nothing more than boring or crap way.
so I will suggest you to use Connection pooling why take a look below
The .Net framework data provider for SQL server provides connection pooling automatically for the ADO.NET client applications.
Connection pooling enables a data source to reuse connection for a particular user. it also improve performance and enhances scalability.
when an application attempts to open a connection. the Pooler examines the security context and the Polling property of the connection strings, and takes one of the following actions:
a) if the pooling property is false, the pooler opens a new connection rather than attempting to acquire from a pool.
b) if the pooling property is true, which is the default setting, the pooler attempts to acquire a connection from a pool
For more Details you should read an excellent article at given links
http://www.codeproject.com/KB/dotnet/ADONET_ConnectionPooling.aspx
and well known MSDN Links
http://msdn.microsoft.com/en-us/library/8xx3tyca.aspx

Thanks
Ravi Ranjan Kumar
http://raviranjankr.wordpress.com

S.faizaan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: S.faizaan on: 7/12/2011 [Member] Starter | Points: 25

Up
0
Down
Thanks for your answers..


Thanks & Regards,
Faizaan

S.faizaan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: S.faizaan on: 7/12/2011 [Member] Starter | Points: 25

Up
0
Down
yes very nice article.

Thanks & Regards,
Faizaan

S.faizaan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: RaviRanjanKr on: 7/13/2011 [Member] Starter | Points: 25

Up
0
Down
You are welcome Faizaan :)

Thanks
Ravi Ranjan Kumar
http://raviranjankr.wordpress.com

S.faizaan, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response