从数据库中的不同表获取数据到同一行中的gridview [英] getting data from different table in database to gridview in same row

查看:130
本文介绍了从数据库中的不同表获取数据到同一行中的gridview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是asp.net的新手,我想从gridview中的不同表格到同一行获取数据

pl帮助我。

谢谢

i m new in asp.net and i want to get data from different table to same row in gridview
pl help me.
thanks

推荐答案

如果你对SQL有所了解,只需创建一个这样的视图:



创建[NameOfView]视图为

SELECT table1。*,table2。*

FROM table1 JOIN table2 ON table1.SomeColumn = table2.SomeMatchingColumn



then使用NameOfView创建表适配器
If you know something about SQL, just create a View like this :

Create [NameOfView] View as
SELECT table1.*,table2.*
FROM table1 JOIN table2 ON table1.SomeColumn = table2.SomeMatchingColumn

then create your table adapter with NameOfView


这篇关于从数据库中的不同表获取数据到同一行中的gridview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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