If the tables in the database has a primary-key, foreign-key relation then the related column's are available as a sub-entity in the same linq object. for example Employee and Department table related through DepartmentID.here it goes...
From tbl In LocalDataTable _
Select tbl.EmployeeID, _
tbl.FullName, _
tbl.tblDepartment.Department, _
tbl.DateOfJoining, _
tbl.Salary
this is one way of accessing the data from related tables. there are other better ways of doing the same.
from tbl1 in EmpDataTable _
from tbl2 in DeptDataTable _
where tbl1.DepartmentID = tbl2.DepartmentID _
select _
tbl1.EmployeeID, _
tbl1.FullName, _
tbl2.Department, _
tbl1.DateOfJoining, _
tbl1.Salary
(I'm a VB.NET Programmer)
- Regards -
J O N
A good thing is a bad thing if it keeps you from the best thing. - Dr. Adrian Rogers