绑定两个表中的数据 [英] bind data from two tables

查看:54
本文介绍了绑定两个表中的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在gridview中绑定两个表中的字段.

例如表A
栏位:A B C D

表B
字段:E F G H

所以我想将网格与A的前两个filed和B的第一个Filed绑定.

>> E是一个复选框,我想将其与E字段绑定并显示A中的所有记录.

na ....
密特什

 GridView1.DataSource = c.getdata("  + drop_cat.SelectedItem."   + drop_sub_cat.SelectedItem.文本 + " '");
        GridView1.DataBind(); 



这是显示文档表中所有记录的代码,但我希望第一个字段为复选框,并且其值来自第二个表以选中或取消选中该复选框,并且所有记录均从第一个表显示.方案



请参考:

http://aspdotnetcodebook.blogspot.in/2008/04/showing-data- from-multiple-tables.html [ ^ ]

将网格视图与多个表绑定. [GridView1.DataSource = c.getdata("select id,title,bit_indicator from document where category='" + drop_cat.SelectedItem.Text + "' and subctgry='" + drop_sub_cat.SelectedItem.Text + "'"); GridView1.DataBind();



this is code which display all records from the document table but i want first field which is checkbox and it value come from second table for checked or unchecked the checkbox and all records display from the first table.

解决方案

Hi,

Refer to :

http://aspdotnetcodebook.blogspot.in/2008/04/showing-data-from-multiple-tables.html[^]

Binding a gridview with multiple table.[^]


这篇关于绑定两个表中的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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