我希望数据来自单个gridview中的表格,我可以这样做 [英] i want data from to tables in a single gridview can i do it

查看:58
本文介绍了我希望数据来自单个gridview中的表格,我可以这样做的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有表数据库

1- payout_transcation

2- payout_master

i希望在单个gridview或datagrid中来自这两个表的数据



我能做到这一点......

i have tables database
1- payout_transcation
2- payout_master
i want data from both this tables in a single gridview or datagrid

can i do that...

推荐答案

Hello Sumit,



您可以使用Join从两个表中获取数据



转到: SQL加入



希望它能为您提供帮助。
Hello Sumit,

You can use Join to fetch the data from two tables

Go To : SQL Join

Hope it will help you.


如何这些表是相关的...意味着关系



如果payout_transcation表包含来自payout_master的Forienkey关系,那么

1)写一个查询加入2桌。然后将结果集绑定到DataGrid或GridView



2)在两个表上创建一个视图,然后查询视图并将结果集绑定到DataGrid或GridView



请查看以下样本查询

How these tables are related... means relationship

if the payout_transcation table contains Forienkey relationship from payout_master, then
1) write a query joining 2 tables. Then bind the resultset to DataGrid or GridView
or
2) Create a view on both table and then query the view and bind the resultset to DataGrid or GridView

Please find the following query for sample
SELECT PT.*, PM.* FROM payout_transcation AS PT INNER JOIN payout_master AS PM ON PT.<forienkey> = PM.<primaykey>
</primaykey></forienkey>



希望它可以帮到你

快乐编码:)


Hope it helps you
Happy Coding :)


加入2个表并将结果绑定到网格视图。
Join the 2 tables and bind the result to your grid view.


这篇关于我希望数据来自单个gridview中的表格,我可以这样做的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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