如何添加&根据从下拉列表中选择的国家/地区名称,检索SQL服务器(内置于VS)中的国家/地区标志的图像? [英] How to add & retrieve images of a country flag in SQL server(inbuilt in VS), based on country name selected from the dropdown list?

查看:96
本文介绍了如何添加&根据从下拉列表中选择的国家/地区名称,检索SQL服务器(内置于VS)中的国家/地区标志的图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试存储国家标志的图像,国家的首都,Sql server中的符号(内置于VS中)并添加了国家/地区名称的下拉列表。



要清除,从下拉列表中选择国家/地区后,我需要在详细信息视图中显示相应的所选国家/地区的标志和其他详细信息(首都城市,符号等)。



请回复上述问题。

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.

推荐答案

嗯,你没有提供那么多信息,所以这是我最好的猜测。





1.

将图像放在一个公共文件夹中并存储文件的路径以及数据库中的countryname。



2.加载下拉列表时,不要仅加载国家/地区名称,而是将下拉列表绑定到country对象,其中您将名称显示为文本,但在下拉项目后面您有整个对象(标记图像路径,国家/地区名称,大写名称......)。



3.更改下拉项处理时,事件检索对象,从对象获取标记图像路径,并将该图像从磁盘加载到控件中。



一次开始出现小问题,你就可以到达那里。

如果是ASP.Net,你可能需要设置一些图像存储文件夹的访问权限。



希望这会有所帮助。
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.


这篇关于如何添加&根据从下拉列表中选择的国家/地区名称,检索SQL服务器(内置于VS)中的国家/地区标志的图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆