Click here to Skip to main content
12,505,335 members (70,957 online)
Rate this:
 
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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.160927.1 | Last Updated 12 Jan 2013
Copyright © CodeProject, 1999-2016
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