473,793 Members | 2,922 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Best practice for showing data from diferent queries in same form

I need to make something like this:

http://www.corobori.com/sos/picDemartti.jpg

That is the 1st time I am doing like this in ASP.NET (did it tons of
times in "old" ASP) so I would like to do it the "right way" from the
beginning.

Data to populate 1A and 1B are from one query, 2A and 2B from another
and 3A and 3B from a 3rd query. Each of them will be clickable with a
popup window showing a larger pic and more text.

It is not a list with paging or sorting. I just need to show 6 shoes. I
need to randomly select 2 children's shoes for the left column; 2
women's shoes for the central column and 2 men's shoes for the 3rd
column

So, what's the best to do this ?

Jean-Luc

Nov 19 '05 #1
5 1159
How big are the datasets?

Can you cache them in memory as datatables then do a random selection?

Nov 19 '05 #2
Very small datasets. I guess no more than 50 records

Nov 19 '05 #3
"Corobori" <jl****@corobor i.com> wrote in news:1115385907 .074223.168810
@o13g2000cwo.go oglegroups.com:
It is not a list with paging or sorting. I just need to show 6 shoes. I
need to randomly select 2 children's shoes for the left column; 2
women's shoes for the central column and 2 men's shoes for the 3rd
column

So, what's the best to do this ?


I would use a multi-statement random select and place it into a single
dataset.

On output, I would output the datagrid.

--
Lucas Tam (RE********@rog ers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 19 '05 #4
But how can I say that records 1 and 2 should got into 1st col 1st and
2nd row; records 3 and 4 in 2nd col 1st and 2nd row; records 5 and 6
in 3rd col 1st and 2nd row ?

Nov 19 '05 #5
Here is how I did it:

1) I created a UserControl representing one cell including a repeater
and I bind it to the db with a parameter for selection

2) I created a form with 3 labels as a place holder. Then I added the
following code:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
  2. System.EventArgs) Handles MyBase.Load
  3.  
  4. Dim tempUserControl = Page.LoadControl("Cell.ascx")
  5. tempUserControl.DisplayDataType = "1"
  6. cel1.Controls.Add(tempUserControl)
  7.  
  8. tempUserControl = Page.LoadControl("Cell.ascx")
  9. tempUserControl.DisplayDataType = "2"
  10. cel2.Controls.Add(tempUserControl)
  11.  
  12. tempUserControl = Page.LoadControl("Cell.ascx")
  13. tempUserControl.DisplayDataType = "3"
  14. cel3.Controls.Add(tempUserControl)
  15.  
  16. tempUserControl = Nothing
  17. End Sub
  18.  
My reference is
http://www.dotnetjunkies.com/Tutoria...9AF776E21.dcik

What do you think ?

Jean-Luc
http://www.corobori.com

Nov 19 '05 #6

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

Similar topics

9
4522
by: Wm | last post by:
As an amateur wannabe-pro programmer, I am trying to learn not only how to use PHP but how to do it *efficiently*. (Trust me, you don't wanna see some of my stuff!!!) I'm noticing a number of my pages have a mixture of HTML and PHP, very interspersed. Example: A form with 20 fields where I echo a variable in each field to show existing data. My question is really about the best practice to do this, as I have seen some interesting use of...
17
8042
by: | last post by:
I have an app that retrieves data from an Access database. At the moment I have the SQL string as a Const in my app. I understand this is not best practice. I don't want the user to have access to read or modify this string so I don't want to store it in an INI / Text file or in registery. Can someone please tell me the best practice for this. Thanks Mike
15
1976
by: Bob Alston | last post by:
Is it considered best practice to distribute FE databases as MDEs rather than MDBs? Without flaming me for asking the question, could someone please enumerate the key advantages? Also I like to provide my users a mini report writer where the report specs are stored as local data files. Can I do this in an MDE - e.g. have local data files for the report writer spec but no queries, forms or report changes? Thanks.
13
2571
by: G | last post by:
Hello, Looking for opinions on a fairly simple task, new to ASP.net (C#) and want to make sure I do this as efficiently as possible. I have a web based form, and I need to run some SQL before submit, which determines exactly where to send the form contents. The table of "receipients" could contain in the region of 3,500 recipients but is more likely to contain up to 1,000. Table structure:
0
9518
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10430
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10211
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10159
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10000
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9033
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3719
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2917
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.