如何在label中绑定数据集的特定列值 [英] How to bind the particular column value of dataset in label

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

问题描述

亲爱的所有



如何在标签EG中绑定数据集的特定列值:-i想要显示数据集中开始的日期母版页中的标签



请任何人帮助我

先谢谢

Dear All

How can i bind a particular column value of dataset in label E.G:-i want to display the date which is begin in the dataset in the label in master page

Kindly any one help me
Thanks In Advance

推荐答案

label.text = ds.tables [0] .rows [0] [Date]。ToString();
label.text = ds.tables[0].rows[0]["Date"].ToString();


你可以尝试这个,因为你提到标签是要在主页面中更新



标签lbDate = this.Master.FindControl(lbDate)作为标签; //从MasterPage访问标签以分配

lbDate.Text = Convert.Tostring(ds.tables [0] .rows [0] [Date]);
You can try this as you have mentioned the label is to be updated in the master page

Label lbDate = this.Master.FindControl("lbDate") as Label;// accessing the Label from the MasterPage to assign
lbDate.Text = Convert.Tostring( ds.tables[0].rows[0]["Date"]);


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

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