ASP .NET网格控件的列值

编程入门 行业动态 更新时间:2024-10-18 16:47:47
本文介绍了ASP .NET网格控件的列值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有以下连续格的网格 studentid studentname studentcollegeid(foriegnkey) 现在,当我显示结果studentcollegeid将显示在网格中时,我想显示该ID的大学名称,我该怎么办该bcz子表具有FK,如上文所述,我可以使用任何方法使我显示大学名称而不是id. "h2_lin">解决方案

进行正确的SQL查询或LINQ,然后尝试填充网格控件.例如,假设College 表存在并且包含CollegeID, CollegeName列.然后 SELECT studentid, studentname,collegeName FROM Student INNER JOIN College ON College.CollegeID = Student.StudentCollegeID 希望对您有帮助.

i have grid which has following coloumn studentid studentname studentcollegeid(foriegnkey) now when i display result studentcollegeid will displayed in grid i want to show college name against that id how can i do that bcz child table has FK as i explain above can any method so that i display college name instead of id thanks

解决方案

Make proper SQL query or LINQ and try to populate your grid control.E.g, Assuming that College table exists and contains CollegeID, CollegeName columns. Then SELECT studentid, studentname,collegeName FROM Student INNER JOIN College ON College.CollegeID = Student.StudentCollegeID I hope this will help you well.

更多推荐

ASP .NET网格控件的列值

本文发布于:2023-11-11 05:54:02,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1577563.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:网格   控件   ASP   NET

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!