Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 1.1
This is the forum to discuss the Wrox book Beginning ASP.NET 1.1 with Visual C#.NET 2003 by Chris Ullman, John Kauffman, Chris Hart, Dave Sussman, Daniel Maharry; ISBN: 9780764557088
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 19th, 2006, 05:56 PM
Authorized User
 
Join Date: Jun 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Updating a Dropdown list

Hi all,

I am trying to load data from a database query into a asp:dropdownlist. The idea is to return a complete set of fixtures from a football match and then filter them further so the user can select a date from the drop down list to limit the results.

I have implemented a straight databind to the dropdownlist from a datareader but I want the dropdownlist to load 'after' the first search option has been chosen (by an initial dropdown list), thus filtering them further.

e.g. user selects league 1 from the first drop down list. The query brings back all league 1 fixtures I then want the 2nd dropdownlist populated with the dates retrieved from the first query and when the user selects the 2nd dropdownlist (dates) I want the info displayed.

What do you think my best approach would be, datatable, dataset etc.

All help most appreciated.
Paul.
__________________
Life is about 2nd Chances..... I\'m on my 4th.... Have Fun in Life.
 
Old February 20th, 2006, 02:30 PM
Authorized User
 
Join Date: Jun 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi To all those that read my topic.

I have managed to figure the problem out by using a datalist. I was looking at the problem to in such a complex manner I failed to spot the obvious I have pasted my code below.


If (Request.QueryString("id") <> "") Then
objCmd = New OleDbCommand("SELECT [p].[name], [p].[playerid], [p].[description], [p].[picture1], [p].[picture2], [p].[height], [p].[dob]," & _
"[pp].[description] AS [position] FROM [player] as [p], [playerposition] as [pp]" & _
"WHERE [pp].[positionid]=[p].[positionid] AND p.playerid=" & Request.QueryString("id"), objConn)
objRdr = objCmd.ExecuteReader()
dlPlayerDetails.DataSource = objRdr
dlPlayerDetails.DataBind()
dgFirstTeam.visible = "false"
objRdr.Close()
etc etc......

Where I have 'bolded' the text was my discovery. Before I was literally putting the names of the tables in and not the actual query.

Hope that makes sense and helps anyone in the same problem.

Regards,
Paul.

  Hutchyman
Just Remember
Never Give Up.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Updating a table from a dropdown GS ASP.NET 2.0 Basics 2 March 18th, 2007 07:22 AM
Updating table from dropdown list GS ASP.NET 2.0 Professional 2 March 18th, 2007 07:22 AM
Updating a textbox from DropDown selection kjord ASP.NET 1.0 and 1.1 Professional 4 November 7th, 2006 04:04 AM
fill dropdown list with items when parent list isaac_cm Pro PHP 1 July 10th, 2006 05:41 AM
HELP WITH DROPDOWN LIST enavas Excel VBA 1 April 6th, 2004 02:08 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.