Read the tag UID and save on the database

To read the UID from a Mifare Classic and save it on the database is needed to configure some steps.

The first step should be to create a Storage Item on the database connection, to do it please follow the steps below:

Go to the database connection and on the Add and remove storage items click on Add.



On the Storage-item properties fulfil with the item name (UID), Table name (Go), the primary key of this table (ID) and with the column where do you want to save the data (ExtraTextField).

Below this form, please select the Storage-item usage in this case will be Store data after printing a card, since, is during the print job that the card will be placed on the reader position and be available to be read.



To close the database connection after adding the Storage-item, please click on Finish.

To check if the Storage-item was created correctly on the Card designer you can look the Data tab and check if the Storage Items option is available there and if the added field is also there UID.



Next, we need to create a Mifare read definition, please note that just to read the UID is not necessary to configure anything on the Mifare read definition, if you need to read some data from a sector and block, then you need to configure it during the Mifare read definition.



As soon as you have finished to configure the Mifare read definition, you should have also be able to check if it was correctly created if you have the Mifare® Classic read item option available on the Data tab.

Next, please select the Storage Item and double-click on it, it will open the properties window, select Content.
On the drop-down list that says Fixed value, click on it and change it to Mifare® Classic UID. This will assign the operation to the Storage-Item that was configured during the database connection, CardExchange Producer/TrustID will read the UID and save it on the database field that was configured in my case on ExtraTextField1.


This will now save the UID of the Mifare card in the Database in decimal value.


Formatting UID for alternative value

From default the format is in Decimal value, if you need to change it use the drop-down list with the other available options.

If you need to use leading zeros you can on the text box in front of the format to add d10 where d stands for Decimal and the number stands for the number that the field will have in this case 10 digits.

If you want to have in hexadecimal, just change the d for x or X.



And this is how you can read your tag UID and save it on a database using CardExchange Producer or TrustID.