Click here to Skip to main content
15,915,772 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have two table:1)profile-->fields are:
prof_id
name
address
city_id
mob_no
emailid
log_id

2)login--->fields are:
log_id
username
password

and my page for profile contain
name: textbox
address:textbox
city:dropdownlist
mob.no:textbox
emailid:textbox
username:textbox
password:textbox


now ,I have to fill data from both this table to all this textbox.
username,password are taken from login table and remaining data come from profile table.
I know how to fill data from single table ,but i don't know for this problem that how to fill textbox from more then one table.please help me.
Posted
Comments
Member 9581488 20-Dec-12 12:25pm    
have you tried anything???
BC @ CV 20-Dec-12 12:32pm    
Of course not!
Why do the work himself when he can just post a question and get back completed code[^].
Member 9581488 20-Dec-12 12:37pm    
good one....!!
:)

 
Share this answer
 
C#
string sql="select name,
 address,
 city_id,
 mob_no,
 emailid,username
 password from profile f,login l where f.log_id=l.log_id"
//write code for fill result in dataset 

TextName.Text=ds.Tables[0].Rows[0]["name"].ToString();
//write same like above


Thanks
 
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