ASP.NET和C#表单,其中所有datqa从两个表中显示 [英] ASP.NET and C# form with all datqa showing from two tables

查看:78
本文介绍了ASP.NET和C#表单,其中所有datqa从两个表中显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

帮助...我是新手,已经受命创建dB.我已经创建了SQL Sewrver表和一个Web项目.我需要帮助将两个表中的信息显示为1个Web表单,而不必使用分页. 1个表中只有1行,而2nd表中有很多行.我已经创建了一个表单,并且可以正常工作,但是我必须翻页才能查看第二个表中的所有数据.

Help... I am a novice and have been tasked to create a dB. I have created SQL Sewrver Tables and a web project. I need help diplaying information from two tables into 1 web form without haveing to use paging. There is only 1 row in 1 table and many rows in the 2nd table. I have created a form and it is working but I have to page to see all the data from the 2nd table.

推荐答案

您可以在SQL查询中使用内部联接从两个表中选择记录.
尝试以下语句:

You can use inner join in your sql query to select records from both tables.
Try something like following statement :

select table1.*,table2.*
from table1
inner join table2 on table1.Column1 = table2.Column1
where table1.Column1 = SomeValue


这篇关于ASP.NET和C#表单,其中所有datqa从两个表中显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆