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

select *

I can not get a real answer to this question. Can you help?

I have a gridview and a sqlserver datasource.
I also have a dropdownlist of countries.

The gridview displays a bunch of crap about whatever country is selected in
the countries dropdownlist

I want to add a selection "ALL COUNTRIES"

but what would its value be?

What would it's value be to cause the select statement to choose "ALL
COUNTRIES"?

thank you

(also, please don't answer this question unless you are answering this
question, you will see why soon)
Jan 22 '07 #1
3 1464
Just change the AppendDataBoundItems property of the DDL to 'True' - then,
add your item to the DDL ("All Countries"), making the value 0 or whatever
you want - the rest of the answer depends on how you're using the DDL in
your query (value or text)

--
David Wier
MVP/ASPInsider
http://aspnet101.com
http://aspexpress.com

"Mr. SweatyFinger" <sw@sw1finger.comwrote in message
news:ON**************@TK2MSFTNGP05.phx.gbl...
I can not get a real answer to this question. Can you help?

I have a gridview and a sqlserver datasource.
I also have a dropdownlist of countries.

The gridview displays a bunch of crap about whatever country is selected
in
the countries dropdownlist

I want to add a selection "ALL COUNTRIES"

but what would its value be?

What would it's value be to cause the select statement to choose "ALL
COUNTRIES"?

thank you

(also, please don't answer this question unless you are answering this
question, you will see why soon)


Jan 22 '07 #2
You could dummy up an "ALL COUNTRIES" entry by modifying your Sql like so:

SELECT "ALL", -1

UNION ALL

SELECT CountryName, CountryId
FROM Country

If you take action based on the selected country, then you will need to
modify your code to watch for -1 ie ALL COUNTRIES and take appropriate
action.

Hope I have Helped.

--
With Regards
Shailen Sukul
..Net Architect
(MCPD: Ent Apps, MCSD.Net MCSD MCAD)
Ashlen Consulting Services
http://www.ashlen.net.au
"Mr. SweatyFinger" <sw@sw1finger.comwrote in message
news:ON**************@TK2MSFTNGP05.phx.gbl...
I can not get a real answer to this question. Can you help?

I have a gridview and a sqlserver datasource.
I also have a dropdownlist of countries.

The gridview displays a bunch of crap about whatever country is selected
in the countries dropdownlist

I want to add a selection "ALL COUNTRIES"

but what would its value be?

What would it's value be to cause the select statement to choose "ALL
COUNTRIES"?

thank you

(also, please don't answer this question unless you are answering this
question, you will see why soon)


Jan 22 '07 #3
where do i do that?

Just change the AppendDataBoundItems property of the DDL to 'True'
are you sure you are answering my question?
Really sure?

Jan 22 '07 #4

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

Similar topics

1
by: JT | last post by:
I have an input form for which I've created a "matrix" for user input. Basically, the user chooses a radio button and then through javascript, a select box is displayed to define a value for that...
4
by: Elroyskimms | last post by:
Using SQL 2000... tblCustomer: CustomerID int CompanyName varchar(20) HasRetailStores bit HasWholesaleStores bit HasOtherStores bit tblInvoiceMessages:
4
by: bobsawyer | last post by:
I've been building a series of SELECT lists that are populated dynamically using HTTPRequest. Things are going pretty well, and I've got the whole thing working flawlessly in Mozilla/Firebird....
3
by: dumbledad | last post by:
Hi All, I'm confused by how to replace a SELECT statement in a SQL statement with a specific value. The table I'm working on is a list of words (a column called "word") with an index int...
10
by: serge | last post by:
Using "SELECT * " is a bad practice even when using a VIEW instead of a table? I have some stored procedures that are identical with the difference of one statement in the WHERE clause. If I...
1
by: serena.delossantos | last post by:
Trying to insert into a history table. Some columns will come from parameters sent to the store procedure. Other columns will be filled with a separate select statement. I've tried storing the...
9
chunk1978
by: chunk1978 | last post by:
hey everyone, i've been trying to solve this problem for 2 days straight, with no end in sight. i would greatly appreciate anyone's help. EXPLANATION: There are 3 Select Menus. The 1st and...
2
by: naima.mans | last post by:
Hello, i want to select 2 following brothers nodes wich are one under another (one closed to another)... i have done one xslt file... but it's not really good.. for example: the xml file:...
4
by: rn5a | last post by:
A Form has 2 select lists. The 1st one whose size is 5 (meaning 5 options are shown at any given time) allows multiple selection whereas the 2nd one allows only 1 option to be selected at a time. ...
6
by: Apaxe | last post by:
In the database i have a table with this information: key_id =1 key_desc =43+34+22+12 I want sum the values in key_desc. Something like: SELECT key_desc FROM table But the result of...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.