how to find dropdownlist selectedvalue in dataset datatable to update foreign key in another table

  • Thread starter Thread starter TSA
  • Start date Start date
T

TSA

Hi all,

Here's scenario:

Table 1:
Table1_pk
A
B
C
Table2_fk

Table 2:
Table2_pk
A
B
C


I have dropdownlist on a webform which selects value B from Table 2.
When I select a value from the dropdownlist, I need able find
Table2_pk for that selected value and insert into Table2_fk column
when updating Table 1.


Thanks for your help.
 
All depends on how it's bound. Typically, the PK is bound to the combo as
the ValueMember. Then to pick it up on selection, it's simply
Cint(cmbWhatever.SelectedValue).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top