0

Hi Guys
I am trying to select and display on the RadGrid. i am using sqlDataSource. i have 2 Tables (Users and DealerShip). User table i have attributes (UserID(pk),UserName,Email,Phoneand DealerShipID(fk)) on DealerShip table i have attributes (DealerShipID(pk),DealerShipName) and now here is what i want to do. on my grid i will have a drill down like a treeView, the DealerName will be like a masterview where you drill down you can find all the users that belong to that specific DealerShip, for example i will have three Dealers (a,b,c) which have different users under each, Business Rule (one user can only belong to i Dealership and one Dealership can have many users.) please can one assist on how to right a SELECT statement which will display all the users per Dealership?

Thanks.

2
Contributors
2
Replies
35
Views
2 Years
Discussion Span
Last Post by Praise92
0

Something like this:

SELECT 
    d.DealerShipID, 
    d.DealerShipName, 
    u.UserID, 
    u.UserName,
    u.Email,
    u.Phoneand 
FROM DealerShip d 
    LEFT JOIN Users u 
    ON u.DealerShipID = d.DealerShipID
    WHERE d.DealerShipName IN('a', 'b', 'c');

Edited by AndrisP

0

Hi AndrisP,

see attached after using the same method you send, it is still giving me the same User for all the DealerShip whereas the is deferent users for each Dealer.

Thanks

Attachments Output.PNG 12.49 KB Output.PNG 12.49 KB
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.