How to connection database to avoid "new" new connection in usecontrol.

How to connection database to avoid "new" new connection in usecontrol. 

When a page including serveral usercontrol, every usercontrol may access database. but how to let usercontrol use connection in main page instand build a new one.

0
zhangweijie
8/26/2006 3:41:27 PM
asp.net.getting-started 91979 articles. 3 followers. Follow

1 Replies
441 Views

Similar Articles

[PageSpeed] 41

Given that the connections are pooled, the general rule of thumb is to let each control:

1) acquire its own connection right when it is needed (and no earlier)
2) use that connection for the minimum amount of time possible
3) close the connection as soon as possible (return it to the pool)

when open connections are available in the pool, step 1 takes very little time.

if you open a connection and hold it for the lifecycle of your page and try to share it, you actually defeat the built in pooling and may cause your site to perform worse.


Mike Banavige
~~~~~~~~~~~~

Need a site code sample in a different language? Try converting it with: http://converter.telerik.com/
0
mbanavige
8/26/2006 8:45:46 PM
Reply:

Similar Artilces:

Unable to get "New View" in Views node of Data Connections in VS .Net 2003
Hi i am trying to create a "new view" from VS .Net 2003. The MSDN article at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vbtchDesignTimeDataToolsInVisualStudioNET.asp    gives the procedure to do that as "Right-click the Views node, then click New View on the shortcut menu." But my problem is that i don't get that New View in the shortcut menu of the Views node in "Data Connections". I am already connected to sqlserver on the local machine. Any help here to create a "new view" from VS .Net 2003 would be appreciated.Thanks any ideas...

"Get Mail" vs "Get All New Messages"
I have a few different email accounts set up in Thunderbird, and I'm using the unified view to view them. Recently, I noticed that the "Get Mail" button seems to only retrieve email for the first account (sometimes?). I'd like to click on that button and retrieve email for all of the accounts. I can get the behavior that I want consistently if I pull down the menu for "Get Mail" and select "Get All New Messages", but I'd prefer to get that in a single click if possible. I tried starting from scratch and recreating my profile, but I st...

On converting "new" to "new(std::nothrow)"
This post is following up on discussions in https://bugzilla.mozilla.org/show_bug.cgi?id=353144 where it was suggested to post in the newsgroups to attract more attention to the problem and discuss possible solutions more in the open. (Most) code in the Mozilla project is written under the assumption that the C++ operators new and new[] return NULL on failure (when memory allocation fails). This is actually not the case, or at least not for GCC compiled code. What happens is that the bad_alloc exception is thrown. As this is never checked for in the code this will lead to crashe...

"connect" not connecting
--047d7b6daa88824eef04e00a3d35 Content-Type: text/plain; charset=ISO-8859-1 I have been using DBI for several years, and have a fairly extensive group of programs that relay on DBI to connect to a database and extract data. All my programs use a common library of functions that includes a function which connects to the database: $dsn = 'dbi:ODBC:prod1' ; $user = 'user' ; $passwd = 'XXXXXXXX' ; $dbh = DBI->connect($dsn, $user, $passwd, {RaiseError => 1, AutoCommit => 0}) or die "Could not connect to database: "...

"Add new Contact"-Dialogbox should be a single windows and not "connected" to Thunderbird, so Drag&Drop from opened Mail is possible
Name: Florian Witteler Email: ivandotder.schrecklicheatgmx.net Product: Thunderbird Summary: "Add new Contact"-Dialogbox should be a single windows and not "connected" to Thunderbird, so Drag&Drop from opened Mail is possible Comments: When adding Contact-Information to the adressbook via "Rightclick on the sender's mail-adress, add to adressbook", the Dialogbox is in front of Thunderbird and Thunderbird itself is not accessible with the mouse. This makes it impossible to Drag&Drop Information from an email into the Dialogbox. It woul...

ASA 8.0.2 refuse new tcpip database connections because "TCP Listener shutting down"
Hi, i have a problem with the ASA 8.0.2.4293. After a while it's impossible to astablished new connections via tcpip to the database server. When i look in the database log i see that the database server has shutdown the tcp listener with code 1232, but i don't know the reason why. Has everyone a solution to solve this bug. Thanks, Carsten You might want to show the exact information from the log but for what it is worth From the Microsoft error lookup utility this is what a network failure with that error code means 1232 The network location cannot ...

"connections to SQL server files (*.mdf)" error message in Visual studio when adding a new SQL database
Hope you can help. Running Visual Studio 2005 and SQLServer2005.  I have created a new project and am attempting to add a new SQL database to it.  When I select the SQL database I get an "Connections to SQL server files (*.mdf) requires SQL Server Express to function properly" error message.  I also tried to add an existng database and it errors out as well "The file can not be opened as it is being used by another process.....".  However, I can create a new data source connection to existing SQL databases.  One caveat though.  I can ...

How does one add a "new" platform or "new" OS to Bugzilla?
How does one add a "new" platform or "new" OS to Bugzilla? syedk01, On 22 Apr 2005 10:55:18 -0700, syedk01@hotmail.com <syedk01@hotmail.com> wrote: > How does one add a "new" platform or "new" OS to Bugzilla? one edits localconfig (or, on the tip, one opens editvalues.cgi in the browser). Regards Marc -- http://wurblzap.net/ Bugzilla hosting and professional support or, on the tip, one opens editvalues.cgi in the browser). How does one open that ? On 25 Apr 2005 16:55:02 -0700, syedk01@hotmail.com <sye...

Html.someHelper "new" {c#} versus "New With" [vb]
Html helpers can be written in a number of ways:    http://msdn.microsoft.com/en-us/library/system.web.mvc.htmlhelper.aspx   http://msdn.microsoft.com/en-us/library/dd492619.aspx          HtmlHelper<(Of <(TModel>)>) Class              Represents support for rendering HTML controls in a strongly typed view.   http://msdn.microsoft.com/en-us/library/system.web.mvc.htmlhelper_members.aspxExample: TextArea(String) Overloaded. Retur...

"Open", "Open in new window", "Open in new tab" are greyed-out after drag&drop operation
Name: Dmitriy Email: dadotivanovathotmaildotcom Product: Firefox Release Candidate Summary: "Open", "Open in new window", "Open in new tab" are greyed-out after drag&drop operation Comments: Steps to Reproduce: 1. Drag&drop a bookmark from the Bookmarks Menu or Bookmarks Toolbar to the Tab bar. 2. Right-click on any bookmark (from the same folder, if darged from Menu, or from the visible part of Bookmarks Toolbar) Result: "Open", "Open in new window", "Open in new tab" are greyed-out Browser Details: Moz...

"Alias is not currently opened. Database server rejected connection. Database server connection limited exceeded."
Hello Sybase Users, Could anyone tell me what's the cause of this error message "alias is not currently opened. Database server rejected connection. Database server connection limited exceeded"? Actually, the sybase server is running and the user is remotely accessing the server. It was when the user used the Interactive SQL remotely that this error came out. Then, he also tried to use the Interactive SQL on the server machine but there was no error encountered. It also came out ONCE when 10 users were simultaneously logging on the system application. What's...

Re: [OT] "new Foo" vs. "Foo -> new()"
John Brooking wrote: >So what ARE the two disturbing ambiguities? >> Not quite. The former is called "indirect object >> notation", a subject that >> owns almost the entire page 446 in the cookbook. I cited the source, and am currently not that interested in the discussion. I just wanted to make sure there was a footnote for people researching the thread in the future. It basically has to do with operator precedence and the context that the indirect object notation is used. Todd W. ...

Difference between "Creating new website" and "Creating new web project"
Hello (Using VS2008) I would like to know the difference between "Creating a New Website" and "Creating a New Web project". Thanks a lot. Hi, the first one creates a web site using the web site project model (default in VS2005) which is based on that you don't have a standalone project file, but project contents are defined by physical directory structure. Basically a web site project has also slightly different compilation model, for example not everything in the project is necessarily built into single assembly, and you don't necessarily ha...

"Alias is not currently opened. Database server rejected connection. Database server connection limited exceeded." error message
Hello Sybase User Experts, I like to find out the cause of this error message "Alias is not currently opened. Database server rejected connection. Database server connection limited exceeded." Do you have any idea about this? What is the cause and how to solve this problem?! Your answer or idea to this error message will be a great help to me. Thank you in advance. Regards, Beverly Beverly, First of all, what database server are you using? And how are you connecting to it? -- Regards, Millard[TeamSybase] <Beverly> wrote in message news:3f7932b1.1356....

Web resources about - How to connection database to avoid "new" new connection in usecontrol. - asp.net.getting-started

Resources last updated: 1/5/2016 4:35:31 PM