AspdotnetCodes.com
Search
Articles
Books
Resources
Asp.Net News
Downloads
Free Tech Magazines
Asp.Net Web Hosting
Archives
Softwares
Newsletter
Suggest Us
Link to Us
Feeds Subscription
Articles
Questions & Answers
Tips & Tricks
 how to show the info of another table (relationship) in Gridview
Posted by Mimi on  9/21/2007 10:27:21 AM Category: Asp.Net 2.0
Add to my favorites
Email to friend
I want to have a gridview which will show the UnitID, Unit, LocationID, Location, Active from Unit table(UnitID, Unit, LocationID, Location, Active) and Location table (LocationID, Location, Active)
thanks

Mimi

Post Your Reply Post New Question

 Viewer's Reply
how to show the info of another table (relationship) in Gridview
Answered By Mel on 9/25/2007 4:30:08 PM
You can create a strongly typed dataset and load it with the following query:

select
a.UnitID, a.Unit, a.LocationID, a.Location, a.Active
from Unit a , Location b
where a.LocationID = b.LocationID
and a.Location = b.Location
and a.Active = b.Active

Set your Gridview datasource to the strongly type dataset table and do a bind.
 
Post Your Reply If you still have problem, post it again under this reply for better response.

 
Sponsored by
Introduction to Software Development
No Nonsense XML Web Development With PHP - Free 146 Page Preview!
Easing the Migration to Microsoft SQL Server 2005