标题:c#如何实现固定信息,自动判断录入
只看楼主
lukebc
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:3
帖 子:74
专家分:32
注 册:2009-8-18
结帖率:71.43%
 问题点数:0 回复次数:0 
c#如何实现固定信息,自动判断录入
如何实现输入编号,如果有此编号的记录,就将此记录的其它字段赋值给相应的textbox中
我写了,但好像不对,不知道怎么改,希望高手帮忙
 if (e.KeyCode == Keys.Enter)
            {
                myclass.opendata();
                DataSet ds = new DataSet();
                SqlDataAdapter adp = new SqlDataAdapter();
                string sql = "select * from materialinfo where bh='" + bh.Text.Trim() + "'";
                adp. = sql;
                adp.Fill(ds);
           
                this.wzlb.Text = ds.Tables[0].Rows[0][1].ToString().Trim();
                this.clmc.Text = ds.Tables[0].Rows[0][2].ToString().Trim();
                this.xhgg.Text = ds.Tables[0].Rows[0][3].ToString().Trim();
                this.jldw.Text = ds.Tables[0].Rows[0][4].ToString().Trim();
            }
搜索更多相关主题的帖子: where 如何 信息 记录 
2016-09-15 20:45



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-468830-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.820612 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved