开发者

"Dereferencing" data from a databound GridView

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 "Dereferencing" data from a databound GridView for the non-co开发者_如何学Pythonmmunity-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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜