QRCode column is not showing in application

Hello,

I am currently doing a Radzen project for an university Data Base course. Everything is working fine, there is only one problem: I have a qrCode column and that column is not showing in my application.

This is my data base table specification:

CREATE TABLE PontoTuristico
	(
	  codPontoTuristico INT NOT NULL,
		CHECK (codPontoTuristico >= 1),
	  descricao NVARCHAR(50) NOT NULL,
	  latitude NVARCHAR(20) NOT NULL,
	  longitude NVARCHAR(20) NOT NULL,
	  url NVARCHAR(250) NULL,
	  qrCode VARBINARY(MAX) NULL,

	  PRIMARY KEY (codPontoTuristico)
	);

And some inserts examples:

INSERT INTO PontoTuristico (codPontoTuristico, descricao, latitude, longitude, url, qrCode)
Values (1, 'Paço Real', '40.209821', '-8.423856', 'https://visit.uc.pt/pt/', (SELECT * FROM OPENROWSET(BULK N'C:\Program Files\Microsoft SQL Server\QRCodes\1.png', SINGLE_BLOB) AS T1));

INSERT INTO PontoTuristico (codPontoTuristico, descricao, latitude, longitude, url, qrCode)
Values (2, 'Jardim Botânico', '40.21094255', '-8.42354114', 'https://www.uc.pt/jardimbotanico', (SELECT * FROM OPENROWSET(BULK N'C:\Program Files\Microsoft SQL Server\QRCodes\2.png', SINGLE_BLOB) AS T1));

In Radzen, the qrCode column is shown in the data source entities, but in the respective table "PontoTuristico" the column is not appearing:

Am I doing something wrong? Can you help me showing the column, please?

I can provide more prints or information if needed.

Many thanks.

Cheers,

Jackeline Rozeno Lopes

Hello @Jackeline Rozeno Lopes,
Just checked an example and this is how we implemented this functionality.

We used sql server with a VARCHAR(MAX) column type. This stored the PNG data in base64 encoded format.


You need to minimize the image data size else performance will suffer.
The Grid column was defined as a template type containing an image control.

Hello @mumfie ,

I'm doing a project alike and I'm having the same issue, I followed your suggestion but it didn't work. Could you possibly show your VALUES ?

Best regards,

Emanuel


Right now this is what appears.

Hi @mumfie!

Many thanks for the quick answer and help!! :slight_smile:

I've tried like you explained and the QR codes are now appearing in the list!! :champagne:

Cheers,
jacke

1 Like

Hi @Emanuel,

What I did was to change:

qrCode VARBINARY(MAX) NULL

to

qrCode NVARCHAR(MAX) NULL

and then change also the insert:

INSERT INTO PontoTuristico (codPontoTuristico, descricao, latitude, longitude, url, qrCode)
Values (1, 'Paço Real', '40.209821', '-8.423856', 'https://visit.uc.pt/pt/', 'data:image/png;base64,xxxxx'));

where 'xxxx' is the PNG image encoded in base64 (just google "convert PNG image to base64 online' for that ;))

and then I change the column template has explained here: Image preview

jacke

1 Like

@Emanuel
Did you bind it to an image control using a column template?
Are you using Angular?


image

1 Like

Hello @Jackeline_Rozeno_Lop and @mumfie

Thank you for helping us, it finally worked. Obrigado

Have a great evening.

2 Likes