用指定的colm绑定gridview [英] bound gridview with a specified colm
本文介绍了用指定的colm绑定gridview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我创建了两个网页.在首页上,用户输入代码.第二页上的数据是从数据库表中获取的,并显示在该指定代码的gridview中.
但我不知道如何用指定的代码绑定网格视图.请告诉我如何绑定它.
在此先感谢
i have created two web pages. on first page user enters a code. and on second page data is taken from a database table and shown in gridview of that specified code.
but i dont know how to bound grid view with that specified code. please tell me how to bound it.
thanks in advance
推荐答案
hi , after u give Gridview datasource
DataField for column Name , HeaderText for the Header
<asp:GridView ID="GridView1" runat="server">
<Columns>
<asp:BoundField DataField="ID" HeaderText="ID header" />
</Columns>
</asp:GridView>
在您的SQL中使用WHERE子句
Use a WHERE clause in your SQL
SELECT ...
FROM table_name
WHERE code = code_to_find
如果您稍微考虑一下,并不是真的那么困难
Not really that difficult if you think about it just a bit
这篇关于用指定的colm绑定gridview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文