有关不在文本框中显示标记ID的帮助 [英] Help regarding not displaying tag ID in a textbox

查看:85
本文介绍了有关不在文本框中显示标记ID的帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





i建立了一个项目,员工将他们的RFID卡扫描并保存到数据库中。

i有一个文本框名称显示Employees TAG id的txtSwipe以及其他进程(如Progressbar和不同类型的消息)都附加了该txtSwipe。我已经在txtSwipe的鼠标CLick事件上编写了代码。



现在当员工刷他/她的卡时我不希望将标签ID显示给用户也在这个点击事件只有数据才能正确保存到数据库中,如果我在文本更改事件中发布代码或任何其他数据未正确保存。



我正在使用的代码在这里:



我尝试过:



Hi,

i have build a Project where Employee Swipes their RFID card and its saved in to database.
i Have a textbox name txtSwipe in which Employees TAG id is getting displayed and other processes like Progressbar and different type of messages all are attached with that txtSwipe. i have written code on Mouse CLick Event of txtSwipe.

now when Employee Swipes his/her card i dont want that Tag ID to be displayed to the USER also ON this click event only data is getting properly saved into database if i post code in text changed event or any other data is not getting saved properly.

code i am using is here :

What I have tried:

<pre> try
            {
                this.Cursor = Cursors.WaitCursor;
                label1.Text = "Working...";

                Application.DoEvents();
                SqlConnection con = new SqlConnection(str);
                con.Open();
                SqlCommand cmd = new SqlCommand("Insert into Datatab(rfid) values (@rfid)", con);
                cmd.Parameters.AddWithValue("@rfid", txtSwipe.Text);
                cmd.ExecuteNonQuery();
                con.Close();
                txtSwipe.ResetText();
                label1.Text = "Done";
            }
            catch (Exception ex)
            {
                label1.Text = "Error";
                MessageBox.Show(ex.Message);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }

            int i;

            progressBar1.Minimum = 0;
            progressBar1.Maximum = 200;

            for (i = 0; i <= 200; i++)
            {
                progressBar1.Value = i;

            }







请帮助。




Please Help.

推荐答案

Never mind i solved it by setting Passchar property of textbox 


这篇关于有关不在文本框中显示标记ID的帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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