Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET SQL-Server
Hi all,
 
I have an asp.net web application and a sql server 2008 R2 database. the application is being used by over than 300 users in the same time, they are retrieving, adding, updating and deleting records simultaneously. The application is opening and closing the connection at each function that executes a query.
I think its wrong to open and close connection for all these times and with that number of users right? but i don't know how to make this better because i'm new with asp.net so can anyone help me and provide me with some better ideas?
 
Thanks in advance.
Posted 12-Jan-13 5:36am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

As far as I know, there is no any issues with opening and closing the connection. Open it when you need it and close it as soon as you're done with it. Connection pooling will automatically handle the reusing the connection.
 
http://msdn.microsoft.com/en-us/library/8xx3tyca(v=vs.90).aspx[^]
  Permalink  
v2

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

  Print Answers RSS
0 OriginalGriff 310
1 Sergey Alexandrovich Kryukov 176
2 PhilLenoir 164
3 Richard MacCutchan 160
4 Sharmanuj 146
0 Sergey Alexandrovich Kryukov 6,077
1 OriginalGriff 5,115
2 CPallini 2,473
3 Richard MacCutchan 1,597
4 Abhinav S 1,505


Advertise | Privacy | Mobile
Web01 | 2.8.140814.1 | Last Updated 12 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100