473,395 Members | 1,919 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,395 software developers and data experts.

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 1142
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****@corobori.com> wrote in news:1115385907.074223.168810
@o13g2000cwo.googlegroups.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********@rogers.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
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...
17
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...
15
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...
13
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...
0
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,...

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.