我需要一些帮助这个问题 我有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
发布评论