Solved

Web Page Design Connected Drop-Downs

Posted on 2010-08-13
4
371 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:tedbilly
Comment Utility
0
 
LVL 18

Accepted Solution

by:
mgfranz earned 500 total points
Comment Utility
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
Comment Utility
worked perfect thank you.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

762 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

9 Experts available now in Live!

Get 1:1 Help Now