Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am trying to store images of the Country flags,Capital city of country,symbol in Sql server(inbuilt in VS) & added a dropdown list of Country name.

To be Clear, upon selecting a Country from dropdown list i need to display corresponding selected country's flag & other details(capital city,symbol,etc) in details view.

Please reply for the above question.
Posted
Updated 20-Jan-15 22:40pm
v2

1 solution

Well you didn't provide that much info, so here's my best guess.


1.
Put the images in a common folder and store the path of the file together with the countryname in the database.

2. When loading the dropdown, don't load the country names only, rather bind the dropdown to the "country" object where you show the name as text, but behind the dropdown item you have the entire object (flag image path, country name, capital name, ...).

3. When changing the dropdown item handle the event retrieve the object, get the flag image path from the object and load that image from disk into a control.

Start with small problems at a time and you'll get there.
If it is ASP.Net you'll probably need to set some access rights to the image storage folder.

hope this helps.
 
Share this answer
 
Comments
Deeepakk 21-Jan-15 7:14am    
To be clear.I have binded dropdown to datasource & added image field in it but the thing is i am not able to get appropriate flag image on selecting particular country from dropdown.
Can you send me code for that.
I need code to match selected value from dropdown & flag image from database.
V. 21-Jan-15 7:17am    
I will NOT send you code for that. I don't have it around and I don't have time to setup a database and code something that might be useful for you, effectively doing your work for you. Look up piece by piece and ask more precise question when they arise.
If you do need code I can always refer you to this site: http://www.rent-acoder.com/
Deeepakk 21-Jan-15 23:31pm    
ok buddy, to be PRECISE
Things i have done:
1.I added list of country name in dropdown list
2.Taken sqldatasource & gridview to display data from database
3.binded the datasource to dropdown list
4.data i have added to database are flag images,capital cities of countries present in dropdown
THATS ALL ABOUT INITIAL SETUP

5.My aim is to display the content(flag,capitalcities) from database upon selecting a country name from dropdown.
ie for eg: upon selecting INDIA from dropdown list, Indian flag & its capitalcity should display in details veiw.
Deeepakk 12-Feb-15 2:47am    
Waiting.
V. 12-Feb-15 3:22am    
I consider this topic closed.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900