Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

i have 3 database tables


this is a dropdown list values displaying table


person
----------------
ID VALUE
---------------
1 sai
2 krish
3 Allah
4 Prabhu

next i am having table like

skills
----------------------
1 God
2 Friend
3 Family
4 relative

this is textbox display from database




Now from the above dropdown database table and text i should get output in the third table by using linq entityframework of My sql.


Id PersonID SkillID
-------------------------
1 1 1
2 1 2
3 2 3
4 4 4

This is a primary key process there should not be any duplicate values from above these three ID's

in my output i should get all dropdownlist values without using seperate query for it.


please send me any related samples or examples


Thanks,
Posted
Comments
Agustee 15-Jun-12 5:54am    
you can try joins in linq

1 solution

hi you can do this by using
C#
ddl1.DataSource = some dataSource;
ddl1.DataTextField = "table column name";
ddl1.DataValueField = "table column name";
ddl1.DataBind();

DataTextField will be the text that will be displayed in dropdown and DataValueField will be the value feild that corresponds to text. both may contain same column as well it depends what information you want to retreive and display.
if you want to retreive differebt feild when some item is selected in dropdown then bind different columns to dropdown

thanks i hope that this may help.
 
Share this answer
 
Comments
Sukanya Karri 15-Jun-12 23:03pm    
Hi thank you so much i will try on this way.
preet88 16-Jun-12 4:54am    
its ok hope it'll help :)

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