Solved

Web Page Design Connected Drop-Downs

Posted on 2010-08-13
4
372 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

895 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now