Hi
How we can create QR code . I want to display Item Code , Description , Expiry Date , Batch No , Quantity.
Thanks
Hi
How we can create QR code . I want to display Item Code , Description , Expiry Date , Batch No , Quantity.
Thanks
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Rajanikant HawaldarRank #110 · 20.2K reputationPosted Jan 22, 2024, 12:15 PM EST
https://www.c-sharpcorner.com/article/creating-qrcode-in-asp-net-core/
https://www.c-sharpcorner.com/blogs/how-to-generate-qr-code-using-asp-net
Leon DRank #851 · 2.6K reputationPosted Jan 22, 2024, 9:17 PM EST
You can use Free Spire.Barcode to easily generate QR code.
https://www.e-iceblue.com/Download/download-barcode-for-net-now.html
Here is the article for your reference:
https://www.c-sharpcorner.com/UploadFile/38268a/generating-qr-code-in-C-Sharp/
Naimish MakwanaRank #324 · 7.7K reputationPosted Jan 23, 2024, 3:13 AM EST
To create a QR code in .NET C# that includes Item Code, Description, Expiry Date, Batch No, and Quantity, you can use a QR code library such as
QRCoder. Here’s a simple example of how you can do this:using QRCoder; using System.Drawing; public class Program { public static void Main() { string itemCode = "ITEM123"; string description = "Sample Item"; string expiryDate = "2022-12-31"; string batchNo = "BATCH001"; string quantity = "100"; string qrCodeData = $"Item Code: {itemCode}, Description: {description}, Expiry Date: {expiryDate}, Batch No: {batchNo}, Quantity: {quantity}"; QRCodeGenerator qrGenerator = new QRCodeGenerator(); QRCodeData qrCodeData = qrGenerator.CreateQrCode(qrCodeData, QRCodeGenerator.ECCLevel.Q); QRCode qrCode = new QRCode(qrCodeData); Bitmap qrCodeImage = qrCode.GetGraphic(20); qrCodeImage.Save("QRCode.png", System.Drawing.Imaging.ImageFormat.Png); } }In this code, we first define the data we want to encode in the QR code. We then create a
QRCodeGeneratorobject and use it to createQRCodeDatafrom our data string. We then create aQRCodeobject from theQRCodeData, and finally, we generate aBitmapimage from theQRCodeand save it as a PNG file.Please note that you’ll need to install the
QRCoderlibrary in your project. You can do this via NuGet Package Manager in Visual Studio.Thanks
Ramco RamcoRank #462 · 5.4K reputationPosted Jan 24, 2024, 11:18 PM EST
Hi Naimish
In below code i am getting error
QRCodeData is an ambiguous reference between QrCoder.qrCodeData and SapBobsCom.qrCodeData
Thanks
Jayraj ChhayaRank #304 · 8.2K reputationPosted Jan 23, 2024, 2:57 AM EST
To create a QR code in Dot Net that displays item code, description, expiry date, batch number, and quantity, you can use a library called "QRCoder." This library allows you to generate QR codes easily and efficiently.
public static Bitmap GenerateQRCode(string data) { QRCodeGenerator qrGenerator = new QRCodeGenerator(); QRCodeData qrCodeData = qrGenerator.CreateQrCode(data, QRCodeGenerator.ECCLevel.Q); QRCode qrCode = new QRCode(qrCodeData); Bitmap qrCodeImage = qrCode.GetGraphic(20); // Adjust the size of the QR code as needed return qrCodeImage; }GenerateQRCodemethod and pass in the data you want to encode:string itemCode = "12345"; string description = "Product description"; string expiryDate = "2022-12-31"; string batchNo = "ABC123"; int quantity = 10; string qrData = $"Item Code: {itemCode}\nDescription: {description}\nExpiry Date: {expiryDate}\nBatch No: {batchNo}\nQuantity: {quantity}"; Bitmap qrCodeImage = GenerateQRCode(qrData);qrCodeImagebitmap to display or save the QR code as needed.Remember to handle any exceptions that may occur during the QR code generation process and customize the code according to your specific requirements.
By following these steps, you'll be able to create a QR code in Dot Net that displays the desired information.