Click here to Skip to main content
15,890,380 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:

C#
<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.
Posted
Updated 27-Mar-17 22:52pm
v2

1 solution

Never mind i solved it by setting Passchar property of textbox 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900