Click here to Skip to main content
15,890,690 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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!
Posted
Comments
srinivas vadepally 15-Nov-11 3:21am    
Hello,
Do you want to bind the data of IssuedItem table into dropdownlist based on the selected addeditem value?
Simply like coutnry,state and city or something else.Can you elaborate it?
Dipankar Basu 15-Nov-11 4:08am    
Do you want to insert id into IssuedItem table based on selected value from DropDownList?? explain.
RaviRanjanKr 15-Nov-11 8:22am    
Whats your effort. Please share some code to us.

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.
 
Share this answer
 
dropdown have two method
one selectedText and second selected value
from both of them u will get id in that
 
Share this answer
 
E.g.

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

ddList.DataValueField will hold the "ID"

Hope this works.
 
Share this answer
 
// If 'id' is integer in database,
int id = Convert.ToInt32(DropDownList1.SelectedValue);

now use " id " to save

Hope this will work.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900