Click here to Skip to main content
16,018,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello All,
I have two tables one is Building Master which has fields (Bid,BuildingName)
and another table is Floor Master which has fields(Fid,Floorname,BID).BID is the foreign key which shows the ID of Building master.I am customized the gridview in floor Page with the help of template field.This grid view will display Floorid,Floorname and Building Name in which that floor exist.But There is problem during Binding.Actually In floor Master Table There is only Building Id and Not Building Name.So How to Bind Template Field In grid view So That it will Brought building Name from Building Master table and will display in Floor page with template Field.


Thanks with Regards,
Amit
Posted

You can use joins while retreiving the data as below:

select Fid, fm.Floorname as floorname, bm.BuildingName as BuildingName
from FloorMaster fm, BuildingMaster bm
where fm.Bid = bm.BID
 
Share this answer
 
try this:

select * from FloorMaster a Left Join BuildingMaster b on
a.BID=b.Bid 
 
Share this answer
 
Join both the table and bind field name in template.
 
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