VB.NET Code 2 of 5 Generator Data Encoding Tutorial
sample source code to input valid data and generate linear Code 2 of 5 images in VB.NET
Setup Code 2 of 5 VB.NET Generator
Code 2 of 5, also known as Standard 2 of 5, Industrial 2 of 5, is a low-density numeric symbology that has been widely used in warehouse, photo finishing and airline industries.
How to generate, print barcode using .NET, Java sdk library control with example project source code free download:
OnBarcode.com provides more details about how to set Code 2 of 5 barcode size and image in Barcode Generator Control on VB.NET:
Codabar VB.NET Generator installation
Code 2 of 5 VB.NET Generator installation
1. Download the trial package and unzip
2. Copy OnBarcode.Barcode.WinForms.dll to your .NET project folder
3. Do not copy dll to .NET bin directory, .NET build tools will do it for you.
4. Add OnBarcode.Barcode.WinForms.dll to .NET project reference
5. Right click .NET Visual Studio Toolbox, select menu Choose Items...
6. In "Choose Toolbox Items" form, click button "Browse...", and select OnBarcode.Barcode.WinForms.dll
7. After selection, you will find four items under "Components" section: LinearWinForm, DataMatrixWinForm, PDF417WinForm, and QRCodeWinForm
After, get it ready in VB.NET by placing the following statement where Code 2 of 5 VB.NET Generator is needed:
Dim code2of5 As OnBarcode.Barcode.Linear
code2of5 = New OnBarcode.Barcode.Linear
code2of5.Type = OnBarcode.Barcode.BarcodeType.CODE2OF5
Select Data for Code 2 of 5 VB.NET Generator
There are three code sets of Code 2 of 5. They are code set A, code set B, and code set C. Code 2 of 5 in different code set encodes different types of data character.
Generate Code 2 of 5 with Numeric Character
Code 2 of 5 is capable of encoding number 0 to 9.
Sample Usage:
Dim code2of5 As OnBarcode.Barcode.Linear = New OnBarcode.Barcode.Linear
code2of5.Type = OnBarcode.Barcode.BarcodeType.CODE2OF5
code2of5.Data = "123"
Make Code 2 of 5 using using Punctuations
Code 2 of 5 encodes - (Dash).
Sample Usage:
Dim code2of5 As OnBarcode.Barcode.Linear = New OnBarcode.Barcode.Linear
code2of5.Type = OnBarcode.Barcode.BarcodeType.CODE2OF5
code2of5.Data = "-"
Valid length for Data in Code 2 of 5 VB.NET Generator
Code 2 of 5 Data Length
Code 2 of 5 is variable length symbology, which easily encodes data at any length.
Data Length in Code 2 of 5 VB.NET Generator
The value of property Data, which is used to define the data in Code 2 of 5, is a string value. You can input data at any length in the string.
Sample Usage:
Dim code2of5 As OnBarcode.Barcode.Linear = New OnBarcode.Barcode.Linear
code2of5.Type = OnBarcode.Barcode.BarcodeType.CODE2OF5
code2of5.Data = "1"
Sample Usage:
Dim code2of5 As OnBarcode.Barcode.Linear = New OnBarcode.Barcode.Linear
code2of5.Type = OnBarcode.Barcode.BarcodeType.CODE2OF5
code2of5.Data = "12345678"