如何通过引用DDL获取id

编程入门 行业动态 更新时间:2024-10-28 01:27:14
本文介绍了如何通过引用DDL获取id的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我需要一些帮助这个问题 我有2张桌子 人(prsID(PK),姓名,fname,DOB ....) 索赔人(prsCLMID(FK),工作......) 我有一个下拉列表,其中包含prsID,名称+''+ fname从表人中选择(仅限姓名+在DDL中填充''+ fname) 我需要从包含personID作为外键的表客户端获取所选DDL值的ID(我该如何检查表人员的姓名和得到他的身份证) 我尝试过的事情: i尝试过

hi plz i need some help in this question I have 2 tables person ( prsID (PK) , name , fname , DOB .... ) claimant (prsCLMID (FK) , job ... ) I have a drop downn list containing prsID, name + ' ' + fname selected from table person (only name + ' ' + fname is populated) in DDL ) I need to get the ID for the selected value of DDL from table client that contains personID as foreign key (how should I check the name from table person and get his ID ) What I have tried: i have tried

Dim dadptclaim As New SqlDataAdapter("SELECT prsid, fname + ' ' + name as na FROM person join claimant on prsID=prsCLMID WHERE (prsID =prsCLMID)", sql) dadptclaim.Fill(ds, "CLM") claimant.DataSource = ds.Tables("CLM") claimant.DataValueField = "prsid" claimant.DataTextField = "na" claimant.DataBind()

推荐答案

使用 ListControl.SelectedValue属性(System.Web.UI.WebControls) [应该返回ID的^ 。

更多推荐

如何通过引用DDL获取id

本文发布于:2023-10-28 23:55:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1538135.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:DDL   id

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!