Click here to Skip to main content
15,894,955 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi i now develop A system in Using C# Language and SQLServer For Database
and this Project use Bar Code Reader and i do not know how to use barcode and how can i attach it to my project thanks For you attention .......
Posted

About 15 years ago, I got the inventory crew to add barcodes to all the inventory in the company's warehouse.

The reader used didn't require any changes to my program. It connected between the keyboard and PC. The user would tab to the serial number field, press a button on the barcode reader, and the scanned serial number would be input. No code required.

Todays barcode readers probably do the same thing with USB.
 
Share this answer
 
Comments
DavidKiryazi 22-Sep-10 4:50am    
Good call.

This seems to be a common practice for a lot of the POS software I have used when working in retail. You just attach a USB scanner to the PC and as long as the user has the input focused on a textbox (or other text reading control) it will work.

I am currently designing a new POS system and will be using this method. It is not necessary (from the customer's perspective) to scan in barcodes magically. The users have been using a particular software since 2000 that requires they put focus onto the sale input box and then scan the barcode. Introducing a new method now would only cause confusion, amounting to more costs in training and extra software development that is COMPLETELY unecessary.
Whether RS232 or USB, barcode readers are serial devices, and you should look to the SerialPort class for implementation details. They emit standard ASCII codes, prefixed by a start code (most often 0 or 7), a barcode consisting of characters and digits, and optionally followed by a checksum digit. The tough part about barcode readers is that there are so many different barcode formats in common use.

About 15 years ago I was directed to buy and implement barcode readers for a hardware store I worked for, and the damned things came unprogrammed, and with no explanation of the different formats, nor did I have any explanation of the format we used. Fortunately we had this brand new thingy called the Internet - literally new, as I was one of the first in the area to sign up for service in 1995 or '96 - and I still managed to find definitions on the web. It's probably a lot easier today...

In summary, implement a serial port reader in your program, find out what barcode format your company uses and search the Internet for a definition, implement a routine to strip out irrelevant characters sent by the reader, and use the text result to search your database for matching items.

These should be unique, by the way. Under a universal agreement, all barcodes consist of two parts - a vendor prefix, and a product identifier. The vendor prefix is assigned by an independent registrar to maintain uniqueness, and the product identifier is assigned by the vendor. Different packages of the same item will have different codes, as well - a 30-piece case of fluorescent light bulbs will have a different code than a single tube from the package. This is a help in shipping and receiving, as software can be easily written to receive a case of 30 as 30 individual pieces.
 
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