Solved

Web Page Design Connected Drop-Downs

Posted on 2010-08-13
4
375 Views
Last Modified: 2012-05-10
I am trying to design a page with linked drop-downs so that when you make one selection the next drop down is limited to items within that selection. My code is listed below. One other problem I am having is that it is listing duplicates of all items that are listed more than once in the database, is there a way to fix that too?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled 1</title>
</head>

<body>

<form id="form1" runat="server">
	<asp:DropDownList runat="server" id="DropDownList1" DataValueField="ReportedBy" DataTextField="ReportedBy" DataSourceID="SqlDataSource1">
	</asp:DropDownList>
	<asp:SqlDataSource runat="server" ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:ChecklistConnectionString %>" SelectCommand="SELECT * FROM [Sorted Responses Comm]">
	</asp:SqlDataSource>
	<asp:DropDownList runat="server" id="DropDownList2" DataValueField="DateReported" DataTextField="DateReported" DataSourceID="SqlDataSource1">
	</asp:DropDownList>
	<asp:DropDownList runat="server" id="DropDownList3" DataValueField="Title" DataTextField="Title" DataSourceID="SqlDataSource1">
	</asp:DropDownList>
	<asp:TextBox runat="server" id="TextBox1"></asp:TextBox>
</form>

</body>

</html>

Open in new window

0
Comment
Question by:141ANG
4 Comments
 
LVL 51

Expert Comment

by:Ted Bouskill
ID: 33435560
0
 
LVL 18

Accepted Solution

by:
mgfranz earned 500 total points
ID: 33436822
When you write a SELECT statement using the *, (everything), you will literally pull everything in the table.  If you use DISTINCT in your query you will not get duplicate records, like this;

SELECT distinct fldTitle FROM myMovies

There is also a qualifier called DISTINCTROW but your database might not accept this.
0
 
LVL 1

Author Closing Comment

by:141ANG
ID: 33468127
worked perfect thank you.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

837 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question