473,507 Members | 3,112 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Do we need to close connection when we use strongly typed table adapters?

Hi,

I saw the Business Logic Layer pattern suggested at the following link and I
found that the pattern never closes the connection:

http://www.asp.net/learn/dataaccess/....aspx?tabid=63

I am using strongly typed datasets and TableadApters. I assume that
TableadApters always closes the connections automatically. Is that correct
assumption?

Any help would be appreciated,,
Max
Jul 11 '07 #1
4 3582
Ysgrifennodd Max2006:
Hi,

I saw the Business Logic Layer pattern suggested at the following link and I
found that the pattern never closes the connection:

http://www.asp.net/learn/dataaccess/....aspx?tabid=63

I am using strongly typed datasets and TableadApters. I assume that
TableadApters always closes the connections automatically. Is that correct
assumption?

Any help would be appreciated,,
Max

As far as I know you never need to close a connection if you use any
kind of DataAdapter (with a DataSet, of course). I am not aware that it
does any harm, though.

HTH

Peter
Jul 11 '07 #2
Hi Max,

I agree with peter that you do not need to explicitly control the open and
close for the SQL connections when using DataAdapter. The dataAdapter's
internal code logic will help you control the connection's open and close.
It is only when you use SqlCommand to return DataReader resultset will you
need to take care of the connection and reader's open and close.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 12 '07 #3
Hi Max,

How are you doing? Have you got any further idea on this? If there is
anything else need help, please don't hesitate to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 16 '07 #4
Hi Steven,

Thanks for followup. I am not explicitly closing the connection when I use
TableAdapter and monitored the connections to database through SQL Profiler.
Everything is working perfect! Thank you

"Steven Cheng[MSFT]" <st*****@online.microsoft.comwrote in message
news:Im**************@TK2MSFTNGHUB02.phx.gbl...
Hi Max,

How are you doing? Have you got any further idea on this? If there is
anything else need help, please don't hesitate to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no
rights.

Jul 17 '07 #5

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

Similar topics

9
2912
by: sk | last post by:
I have an applicaton in which I collect data for different parameters for a set of devices. The data are entered into a single table, each set of name, value pairs time-stamped and associated with...
6
1768
by: Jon Davis | last post by:
I like the drag-and-drop accessibility of dragging a table to a Web Forms designer and seeing a SqlDataAdapter automatically created for me.. being able to create a DataSet from that is fun and...
10
1465
by: pcthug | last post by:
Hi All, I am creating multi-tier app in vb.net using visual studio .net. I create a invoice.vb class file with properties, events and methods. This also has a line item collection class...
1
1888
by: PeterH | last post by:
I am developing a web service in VB.Net that returns data from a server. I have an .asmx page that uses a strongly typed dataset and I would like to return data in the form of strongly typed data...
4
1162
by: Nemisis | last post by:
Hi everyone, I have 2 classes, Company and Contact, a company can have 1 or more contacts. A contact can only be in one company. I have created a Company class object that contains all the...
10
5764
by: cleo | last post by:
I am migrating from VB6/Access to Visual Basic and SQL Express. I have success writing test code on my local machine and am now setting up tests for deployment to a server. I have installed SQL...
2
2709
by: Simon | last post by:
Hi all, Is it somehow possible to do do batched updates with table adapters in the same way you can with data adapters? I expected the methods to be much the same but apparently not. If it...
13
5765
by: PinkBishop | last post by:
I am using VS 2005 with a formview control trying to insert a record to my access db. The data is submitted to the main table no problem, but I need to carry the catID to the bridge table...
1
3538
by: Code Monkey | last post by:
Silly question maybe, but I've been doing the following for far too long now: public static DataTable myDataTable() { string sql = @"SELECT column1, column2, column3, column4 FROM...
0
7109
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
7313
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,...
0
7372
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...
1
7029
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7481
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5619
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,...
1
5039
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
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...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.