By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,165 Members | 840 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,165 IT Pros & Developers. It's quick & easy.

select *

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.