473,322 Members | 1,405 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

accessing the same DB with two calls in two usercontrols...good? bad?

I have a page with a few user controls.

One is the HEADERTAGS (that writes out the tags in the <header> of the page)
and one is MAINCONTENT (that writes out the main body content on the page)

I'm storing the TITLE tag data and the main text data in the same table. How
should I handle getting the above data from this one table via the two
Usercontrols above?

Is it fine to simply have both open a separate connection and grab the
pertinent data? Should only one control grab the data and pass the
information to the other? Does it really matter performance wise on a
smaller site?

-Darrel
Nov 18 '05 #1
2 944
Technically it's bad, although I wouldn't worry about it on a small
site.

If you're using standard data access against SQL Server, ADO.NET is
probably pooling your connections which further cuts down on the
performance penalty.

If you wanted to optimize this, I'd have the page which contains the
usercontrols do the database hit and set properties in the
usercontrols. That's worked well for me in several production
applications.

- Jon
http://weblogs.asp.net/jgalloway

Nov 18 '05 #2
> If you wanted to optimize this, I'd have the page which contains the
usercontrols do the database hit and set properties in the
usercontrols. That's worked well for me in several production
applications.


Hmm...good idea. I'm not going to worry about it for this site (it's so
small) but in the future I think perhaps I'll have once control that's in
charge of getting all data and passing that to the appropriate other
controls.

-Darrel
Nov 18 '05 #3

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

Similar topics

8
by: [RaZoR] | last post by:
hello, main script creates IE window, put an array there and then calls a child script. chils script makes an array element equal to some object and returns control to main script. then main...
2
by: Phl | last post by:
Hi, I have a page with many usercontols and I would like to access other usercontrols from one usercotnrol , so I can access their server controls. This is how I do it, EditProfile...
1
by: Sammy | last post by:
When a user control access SQL Server, what happens if I host it multiple times on one webpage (create several instances of that user control), in terms of trips being made to the server? How can I...
2
by: Vivek Sharma | last post by:
Hi There, I have a situation where I wish to load the controls dynamically on the basis of user role. Hence, I am using this code. if (UserRole == "IS Administrator") { Control UC1 =...
3
by: YYZ | last post by:
I swear I've done my research, and now I was just hoping someone could explain this to me. I've got a base class (usercontrol) that I am using just as an interface. Meaning, I've defined...
7
by: David Laub | last post by:
I've also posted this issue to a Sun/java formum, but since it appears to be an integration issue, this may be the better place to posr: I have written a dot net/c# Web Services doesn't fully...
3
by: Frederick Gotham | last post by:
Back in the day, if you wanted a function to be self-contained within a translation unit, you defined the function as "static". If there were an external linkage function by the same name...
2
by: Vincent | last post by:
I have been trying to find some API routines that will allow me to determine the name of the computer that is accessing a file on a server. I have found the NetFileEnum call (returns the names of...
89
by: Cuthbert | last post by:
After compiling the source code with gcc v.4.1.1, I got a warning message: "/tmp/ccixzSIL.o: In function 'main';ex.c: (.text+0x9a): warning: the 'gets' function is dangerous and should not be...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.