问题描述
我有一个绑定从表中的select语句的GridView。该表中含有大量的按键进行到仅仅ID的其他表。我想在GridView为解引用,因为它是,有问题的字段的ID,并显示在另一个表中找到的可读名称。
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.
目前,浮现在我的脑海里的选项正在撰写用手在codebehind一个DataSet和GridView控件绑定到替代的SqlDataSource或创建存储过程返回表已引用。任何其他的想法或建议,针对这种情况?我使用.NET 2.0%的雇主授权。
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.
推荐答案
我刚刚结束了创建一个观点,即自动取消引用的IDS到其他表,并使用为GridView的基础。
I just ended up creating a view that automatically dereferenced the ids to the other tables and using that for the basis of the GridView.
这篇关于"非关联化"从数据绑定的GridView数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!