如何从下拉列表中选择ID [英] how to select id from dropdownlist

查看:97
本文介绍了如何从下拉列表中选择ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个桌子.
1.AddedItem(id,name,type)
2.IssuedItem(id,name,person)
我已将AddedItem表中的名称添加到下拉列表中.
现在,我想从下拉列表中将ID插入IssuedItem表中.
请帮助我!

解决方案

如果要添加id,则可以在dropdownlist的tag/key或某些id属性中添加,该属性必须在那里不确定. /blockquote>

下拉菜单有两种方法
一个selectedText和第二个选定值
从他们两个中,您都将在其中获得ID


例如

昏暗的ddList作为DropDownList
ddList.DataValueField ="ID":ddList.DataTextField ="Value"

ddList.DataValueField将包含"ID"

希望这行得通.


I have two table.
1.AddedItem(id,name,type)
2.IssuedItem(id,name,person)
I have added name from AddedItem table into dropdownlist.
Now I want to insert id into IssuedItem table from dropdownlist.
please help me!

解决方案

if you want to add id then you can add in tag/key or some id property of the dropdownlist which must be there i m sure.


dropdown have two method
one selectedText and second selected value
from both of them u will get id in that


E.g.

Dim ddList As DropDownList
ddList.DataValueField = "ID" : ddList.DataTextField = "Value"

ddList.DataValueField will hold the "ID"

Hope this works.


这篇关于如何从下拉列表中选择ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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