链接按钮中的记录 [英] records in link button

查看:87
本文介绍了链接按钮中的记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望当我单击配件"按钮时,该配件的所有相关记录

应该到..与配件有关的有四个记录..我已经使用了四个链接按钮,我希望那个四个链接按钮中有四个记录..
我的编码是这个,但是在这唯一的Ist记录中出现了四个链接按钮.

I wants that when i click on accesories button then all the related records of that accesories

should come.. related to accesories there are four records.. i have taken four link button i wants that four records in that four link button..
my coding is this but in this only Ist record is coming in four of the link button..

protected void btnacces_Click(object sender, EventArgs e)
    {
        //take oledb command
        OleDbCommand cmd = conn.CreateCommand();
        cmd.CommandText = "select * from subcategory where cateid=2";
        //take oledb datareadreader
        OleDbDataReader dr;
        dr = cmd.ExecuteReader();
        while (dr.Read())
        {
            LinkButton1.Visible = true;
            LinkButton2.Visible = true;
            LinkButton3.Visible = true;
            LinkButton4.Visible = true;
            LinkButton1.Text = dr.GetString(2);
            LinkButton2.Text = dr.GetString(2);
            LinkButton3.Text = dr.GetString(2);
            LinkButton4.Text = dr.GetString(2);
        }
  dr.Close();
}



请帮助我..



please help me..

推荐答案

亲爱的,

只需使用由dr.read()插入的dr.next()

谢谢

Mahesh Patel
hi dear,

just use dr.next() insted of dr.read()

thanks

Mahesh Patel


这篇关于链接按钮中的记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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