当前位置:编程学习 > C#/ASP.NET >>

c#实现条形码调用 源代码(亲测)

private void textBox1_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyValue == 13)
            {
                OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + "挂号系统.mdb" + ";Persist Security Info=False");
                OleDbDataAdapter dap = new OleDbDataAdapter("select * from MerchandiseInfo where barcode='" + textBox1.Text + "'", con);
                DataSet ds = new DataSet();
                dap.Fill(ds);
                if (ds.Tables[0].Rows.Count == 0)
                {
                    MessageBox.Show("出诊号不存在或诊疗卡已损坏!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                for (int i = 0; i < dataGridView1.RowCount; i++)
                {
                    if (Convert.ToString(dataGridView1[0, i].Value) == "")
                    {
                        dataGridView1[0, i].Value = ds.Tables[0].Rows[0][0].ToString();
                        dataGridView1[1, i].Value = ds.Tables[0].Rows[0][1].ToString();
                        dataGridView1[2, i].Value = ds.Tables[0].Rows[0][2].ToString();
                        dataGridView1[3, i].Value = ds.Tables[0].Rows[0][3].ToString();
                        return;
                    }
                }
            } --------------------编程问答-------------------- --------------------编程问答-------------------- 这是个分享吗? --------------------编程问答-------------------- 你加我QQ吧 513514208 我最近也在开发条形码 --------------------编程问答-------------------- E-Label是一款.NET开发条码标签打印软件,不仅可以使用专业打印机的高级指令功能,也可以普通打印机上输出高精度条码.目前该软件测试中欢迎试用

点击查看.NET条形码打印解决方案
点击查看全图
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,