开发者

Fedup with Ajax Combobox in asp.net, how to stop it from exception if there is no value?

开发者 https://www.devze.com 2023-03-09 08:56 出处:网络
I am using开发者_运维知识库 Ajax auto-complete combobox in asp.net. I fetch values from database and do like :

I am using开发者_运维知识库 Ajax auto-complete combobox in asp.net.

I fetch values from database and do like :

MyCombo.SelectedValue = rd["combovalue"].ToString();

For example - if there is 6 in table but not in combobox values, it gives an exception (this value does not exist in combobox). If there is some value in database but not in combo, it should select the 0 index of combo, instead of doing like this.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号