Barcode Databinding with SmartCodeDeveloper

Requires SmartCodeDeveloper(ver 2.8 and later)

SmartCodeDeveloper's databind feature lets you bind a field from a database with a barcode. To accomplish this, you can simply drag a field from your datasource into SmartCodeDeveloper barcode control.


For simplicity, we will use a Access database file (.mdb) for our tutorial. You can download the database here sample.mdb

1) Create a Windows Forms Application by selecting File::New Project . Name the project Databinding.

2) You will now be at the main screen for the Databinding project. Choose the Data Sources Tab and click on the link Add New Data Source to define a dataset for your application.

3) Choose Database and click Next

4) Click the New Connection button to create a new connection.

5) You will see the following dialog. We will setup our connection here. Since we are using a MS Access database, click the Change button and select Microsoft Access Database File (OLE DB). Click the Browse button and choose the database file sample.mdb you have downloaded. In our example below, we have placed the sample.mdb file in the C:\developer folder.

6) A message box pops up. Click Yes.

7) Use the default name sampleConnectionString. Click Next

8) Choose the Item table and click Finish. You have now successfully defined a Dataset for your application.

9) At the main screen, you will see the sampleDataSet and its tables. The Item table has three fields, Item, ID and Category.

10) Make sure SmartCodeDeveloperControl is in the toolbox. If not, you will have to Right Click the Toolbox and select Choose Items. Click the Browse button and select SmartCodeDeveloper.dll. (The default installation path for SmartCodeDeveloper.dll is

C:\Program Files\TechnoRiver\SmartCodeDeveloper\SmartCodeDeveloper.dll)

11) Drag the Item and ID fields from the Data Sources pane onto the form. Drag an instance of SmartCodeDeveloperControl from the Toolbox onto the form. Your screen look like the following.

12) Now, we are ready to bind the Item field of our dataset to the barcode. Drag the Item field into the barcode. Select the barcode and set its Symbology to Code128.

13) We are now ready to compile and run the application. After a successful build, you will see something as follows