views:

6

answers:

1

I have a GridView that is bound to a select statement from a table. That table contains a lot of keys out to other tables that are just IDs. I would like the GridView to "dereference", as it were, the id of the field in question and display the human-readable name found in the other table.

At the moment, the options that come to my mind are composing a DataSet by hand in the codebehind and binding the GridView to that instead of the SqlDataSource or creating a stored procedure to return the table already "dereferenced". Any other ideas or recommendations for this situation? I am using .NET 2.0 per employer mandate.

EDIT: Please see http://stackoverflow.com/questions/3370038/dereferencing-data-from-a-databound-gridview for the non-community-wiki version of this question. Please also reply to my comment below about community wiki. I get the feeling that the SO community is obsessed with rep and that is like lame.

A: 

The obvious thing to do would be to join to the other tables in your SELECT query and return the text fields directly from the database instead of the IDs.

PhilPursglove