在gridview texbox中绑定数据库中的数据 [英] Bind datas from database in gridview texbox

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

问题描述

大家好,




i使用GridView,我使用模板字段添加文本框,将数据输入gridview.in第二次i尝试使用模板字段中的文本框将另一个数据添加到网格视图中。但是在第二次使用数据源将先前数据加载到网格视图中时,数据源包含所有数据。但问题是网格视图显示没有模板字段的数据。告诉我任何人都可以从数据源中查看模板字段中的数据。

Hi All,


i use GridView and i use template field for add textboxes to enter data into gridview.in second time i try to add another data into grid view withing textboxes in template field.but in that second time when load previous data into grid view using data source.that data source contain all data.but problem is grid view display that data without templet field.please tell me any one can how i view data in template field from the data Source.

推荐答案

试试这个,它可能会对你有帮助。

try this, it may help you.
<asp:TemplateField ShowHeader="true" HeaderText="Status" >
<ItemTemplate>  <asp:Label ID="lblStatus" runat="server" CausesValidation="false"  CssClass="txt" Text='<%# Bind("status") %>'></asp:Label></ItemTemplate>
</asp:TemplateField>





和你这样的查询..



and ur query like this..

string strQry = "Select complain_date,complain_no,pno, problem, pcno, status from call_log where status NOT LIKE('closed') order by complain_date";
            GlobalDs = GlobalConectionClass.ExecuteDataSet(strQry);
            if (GlobalDs.Tables[0].Rows.Count > 0)
            {
                GridCall.DataSource = GlobalDs.Tables[0].DefaultView;
                GridCall.DataBind();

            }
            GlobalDs.Dispose();


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

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