Click here to Skip to main content
15,892,199 members
Please Sign up or sign in to vote.
2.60/5 (2 votes)
See more:
Hello, I want to ask you about how to send data from the barcode reader to SQL Database.I was to Take attendance using barcode reader and check or change student status in the database.for example if the student scans his/her ID on the barcode reader the database automatically from 'absent' to 'present'.how can I do this project using C#?
Posted
Comments
Sergey Alexandrovich Kryukov 30-Apr-13 17:37pm    
OK, feel free to ask about it. :-)
—SA
Richard MacCutchan 30-Apr-13 17:41pm    
The first thing to do is to get hold of the manuals for the barcode scanner and find out what format it presents its data. Then you need to read that data, format it into the appropriate order, and write it to the database. There are many articles in the CodeProject articles section to help you with writing database code.
[no name] 30-Apr-13 17:42pm    
Connect to the database, write an insert or update query to insert or update the information in the database, close the connection. Based on whatever you read from the barcode reader of course.

1 solution

It depends on the interface provided by the reader. To get started, take a look:
http://en.wikipedia.org/wiki/Barcode_reader[^].

Chances are, you can face with so called "keyboard wedge", when the scanner simply plays the role of a keyboard. In this case, you simply need to capture key presses and assemble the text out of them. How to do it? It depends on your application type or UI library you use; and you did not bother to share with us this information.

As to the database… have you ever heard of separation of concerns? This is a totally separate aspect. Brief answer would be: use ADO.NET? Any concerns about it? :-)

—SA
 
Share this answer
 

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



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