下拉列表框值根据数据库值显示 [英] dropdown list box value show according to database value

查看:212
本文介绍了下拉列表框值根据数据库值显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个记录,我想编辑记录,当我点击编辑按钮时,我在表单中显示旧值进行编辑,还有编辑选项中的下拉列表框有办公室代码和办公室名称绑定wigth ddl和我填写整个ddl项目和值现在我希望ddl的值被选为先前选择的用户,值是数据库中的存储我可以在文本框中显示旧值但是如何在ddl中显示旧值

plz使用VB帮助我的代码在asp.net中

i have a record and i want to edit record and when i click on edit button i am showing old values in form for editing and there is also dropdownlist box in edit option there is office code and office name bound wigth ddl and i fill whole ddl items and value now i want that value of ddl is selected as user previously selected and value is stores in database i can show old values in text boxes but how to show old value in ddl
plz help mine code is in asp.net using VB

推荐答案

您可以将旧值存储在变量中,然后设置 selectedvalue 在下拉到此值。
You can store the old value in a variable and then set the selectedvalue in the drop down to this value.


每当我们从数据库中的textvalue中选择值时总是使用trim函数
always use trim function whenever we pick value from textvalue from database


这篇关于下拉列表框值根据数据库值显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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