锐英源软件
第一信赖

精通

英语

开源

擅长

开发

培训

胸怀四海 

第一信赖

当前位置::锐英源 / 英语翻译 / ASP.NET的数据绑定 / 数据绑定数据中继器
服务方向
人工智能数据处理
人工智能培训
kaldi数据准备
小语种语音识别
语音识别标注
语音识别系统
语音识别转文字
kaldi开发技术服务
软件开发
运动控制卡上位机
机械加工软件
软件开发培训
Java 安卓移动开发
VC++
C#软件
汇编和破解
驱动开发
联系方式
固话:0371-63888850
手机:138-0381-0136
Q Q:396806883
微信:ryysoft

Data binding data to Repeater 数据绑定数据中继器

hello all,I am using A Repeater inside it i have label. I am fill the text of label as
你们好,我使用一个里面有标签的Repeater。我填写标签的文本是
protected void rptFoprcast_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemIndex > -1)
{
Label lblTargetPrice = new Label();
lblTargetPrice=(Label)e.Item.FindControl("lblTargetpric");
lblTargetPrice.Text=FillTargetPrice(str1).ToString();
}
}

protected double FillTargetPrice(string str)
{

double n = 0.0;
conn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["ConnString"].ConnectionString);
cmd = new SqlCommand(str, conn);
SqlDataAdapter da = new SqlDataAdapter(cmd);
try
{
conn.Open();
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
n = Convert.ToDouble(dr.GetValue(0));
}
conn.Close();
return n;
}
catch (Exception ex)
{
string msg;
msg = ex.Message;
return n;
}
}

But it is biding the targetPrice find last time to the label time how many time finds. Means suppose result found are 50,30,80 and 120 then label apears 4 times and every times 120 dispays.please help me display label with 4 values.但它是等候targetPrice找到上次的标签多少时间发现。意味着假设结果发现50岁,30岁,80年和120年然后标签天际4次,每一次120幅。请帮我用4值显示标签。


I think all Labels has a same name (lblTargetPrice).That makes all of label shows 120 when you run it.....
我认为所有的标签都有一个相同的名字(lblTargetPrice),当你运行它时,使所有标签显示120,

友情链接
版权所有 Copyright(c)2004-2021 锐英源软件
公司注册号:410105000449586 豫ICP备08007559号 最佳分辨率 1024*768
地址:郑州大学北校区院(文化路97号院)内