在GRIDVIEW中加入两个表

编程入门 行业动态 更新时间:2024-10-26 04:20:24
本文介绍了在GRIDVIEW中加入两个表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

嗨我有两个表,第一个有很多字段,包括department_id。另一个有department_id和部门描述我想在gridview中显示第一个表字段,包括与department_id相关的部门描述 查询:

Hi i have two tables the first have many fields including department_id.The other one have department_id and department description i want to display in gridview first table fields including department description related with department_id Query:

SelectCommand="SELECT [report_no], [datesubmision], [complainee_name], [complainee_surname], [complainee_idnumber], [complainee_tel], [policynumber], [claimnumber], [typeofperson],[department_id],[status_id], [id] FROM [accusationform]" Please help me

推荐答案

您好Nikolas, 以下是您可以使用的查询 Hi Nikolas, Here is the query you can make use of SELECT [acussfrm.report_no], [acussfrm.datesubmision], [acussfrmplainee_name], [acussfrmplainee_surname], [acussfrmplainee_idnumber], [acussfrmplainee_tel], [acussfrm.policynumber], [acussfrm.claimnumber], [acussfrm.typeofperson], [secfrm.department_name], --Here department name is replaced [acussfrm.status_id], [acussfrm.id] FROM [accusationform] AS acussfrm, [secondform] AS secfrm -- Rename secondform to your second table name WHERE [acussfrm.department_id] = [secfrm.department_id] --Here is the condition that reads the common data from two tables with having department_id as common id.

希望这对你有所帮助。 问候, RK

Hope this helps you a bit. Regards, RK

更多推荐

在GRIDVIEW中加入两个表

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

发布评论

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

>www.elefans.com

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