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

Drop Down List Issue

Have a problem with a drop down list that is used to filter results
from mysql table. The dropdownlist popluates with table entries but i
can't get the parameter to pass to the sql statement correctly. Any
help is appreciated. Here's some code:

<%@ Page language="C#" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<script runat="server">

protected void DropDownList1_DataBound(object sender, EventArgs e)
{
DropDownList1.Items.Insert(0, new ListItem("-- All Cities --",
"0"));
}
</script>

<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:eventcalendarConnectionString3
%>"

ProviderName="<%$
ConnectionStrings:eventcalendarConnectionString3.P roviderName %>"
SelectCommand="SELECT organization, user_id, city FROM tbl_users WHERE
for_city = 'London' AND service_type = 'child care' AND status =
'Active' AND city = city limit 30">

<SelectParameters>
<asp:ControlParameter ControlID="DropDownList1" Name="city"
PropertyName="SelectedValue" />
</SelectParameters></asp:SqlDataSource>

<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:eventcalendarConnectionString3
%>"ProviderName="<%$
ConnectionStrings:eventcalendarConnectionString3.P roviderName %>"
SelectCommand="SELECT * FROM tbl_users where for_city='London' and
service_type='child care' and status='Active'">
</asp:SqlDataSource>

<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True"
DataSourceID="SqlDataSource2" DataTextField="city"
DataValueField="city" OnDataBound="DropDownList1_DataBound">
</asp:DropDownList>

Nov 20 '06 #1
0 951

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: deko | last post by:
I populate a drop-down list like this: echo "<select>"; foreach ( $ip_list as $var ) { echo "<option>"; echo $var; echo "</option>"; } echo "</select>";
2
by: Rob Venable | last post by:
I've populated a drop down list from a sql query and the drop down list (select box) looks fine. The issue is... I need to show a blank entry at the top of the select box. In asp I would just add...
2
by: Yoshitha | last post by:
hi I have 2 drop down lists in my application.1st list ontains itmes like java,jsp,swings,vb.net etc.2nd list contains percentage i.e it conatains the items like 50,60,70,80,90,100. i will...
5
by: mc | last post by:
I've got three controls on a page a Drop Down List, a List Box and a Button I've added 3 items to the Drop Down List I have added some code in the Button onClick Event Handler, as below...
3
by: lewisthesmith | last post by:
I'm not really sure if this is a CSS issue, but people here before have been knowledgeable and friendly and so it seems like a good place to start. I'm in the process of building a new site for...
3
by: Brad Isaacs | last post by:
ASP.NET 2.0 / SQL Server 2000 db / Visual Basic Code behind On my .aspx page I have added an SQL Datasource that contains the SQL query to retrieve the list for my Drop Down List Box. Using...
4
by: TycoonUK | last post by:
Hi, As I do not have IE7 on my computer, I was wondering if there is a fault in my CSS Menu when using IE7. Please can someone look at my site - http://www.worldofmonopoly.co.uk and tell me...
0
by: yosri2005 | last post by:
Hello, I'm sure many of you have seen the error message in the subject. I found quiet a few posts on the web regarding this issue, but the ones I saw mainly tackle this issue when you have a...
1
by: swathin2 | last post by:
hello everybody, i am trying to learn php on my own and i have an issue with the drop down box in php. i would like to use 3 drop down boxes one for the state, second for the district and the...
4
by: audreyality | last post by:
I am new to javascript and appreciate any guidance on this issue, so thank you in advance for your advice! Situation: I am working with a form that will send information to a database. I need the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.