QR Code Generator
I want to create a qrcode and stored the qrcode in databases
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
Rijwan AnsariRank #82 · 24.2K reputationPosted Feb 5, 2021, 4:38 AM EST
Amit GuptaRank #190 · 12.8K reputationPosted Feb 5, 2021, 1:16 AM EST
Rajesh GamiRank #30 · 41.5K reputationPosted Nov 18, 2022, 6:30 AM EST
Hello Try below links
https://www.c-sharpcorner.com/article/creating-qrcode-in-asp-net-core/
https://www.c-sharpcorner.com/article/generate-qr-code-and-save-into-the-database/
https://www.aspsnippets.com/questions/208874/Generate-QR-code-Image-and-save-in-Database-using-C-and-VBnet-in-ASPNet/
Leon DRank #851 · 2.6K reputationPosted Nov 18, 2022, 5:29 AM EST
You can search and install Free Spire.Barcode via NuGet(https://www.nuget.org/packages/FreeSpire.Barcode/), then use the below code to generate QR code easily:
using Spire.Barcode; using System.Drawing; namespace QRCode { class Program { static void Main(string[] args) { BarcodeSettings settings = new BarcodeSettings(); settings.Type = BarCodeType.QRCode; settings.Data = "Hello 123456789"; settings.Data2D = "Hello 123456789"; settings.QRCodeDataMode = QRCodeDataMode.AlphaNumber; settings.X = 1.0f; settings.QRCodeECL = QRCodeECL.H; BarCodeGenerator generator = new BarCodeGenerator(settings); Image image = generator.GenerateImage(); image.Save("QRCode.png"); } } }For more information, you can visit this documentation:
https://www.e-iceblue.com/Tutorials/Spire.Barcode/Spire.Barcode-Program-Guide/Create-a-QR-Code-in-C.html
Kip HackmanRank #2,595 · 536 reputationPosted Nov 21, 2022, 11:00 AM EST
You can use LEADTOOLS Barcode SDK technology in your application.
https://www.leadtools.com/sdk/barcode
For your use-case you can leverage the BarcodeWriter class to generate a QR barcode, add it to an image, and export that image to your database.
Here is some sample code:
// Write/Generate Barcode using LEADTOOLS SDK using (RasterImage _image = RasterImage.Create(2550, 3300, 24, 300, RasterColor.White)) { BarcodeEngine _engine = new BarcodeEngine(); BarcodeWriter _writer = _engine.Writer; // Set barcode options QRBarcodeData _qrData = BarcodeData.CreateDefaultBarcodeData(BarcodeSymbology.QR) as QRBarcodeData; _qrData.SymbolModel = QRBarcodeSymbolModel.Model1AutoSize; _qrData.Value = "QR Data 1"; _qrData.Bounds = new LeadRect(0, 0, _image.ImageWidth, _image.ImageHeight); QRBarcodeWriteOptions _options = new QRBarcodeWriteOptions(); _options.GroupNumber = 0; _options.GroupTotal = 0; _options.HorizontalAlignment = BarcodeAlignment.Near; _options.VerticalAlignment = BarcodeAlignment.Near; _options.XModule = 30; _options.ECCLevel = QRBarcodeECCLevel.LevelL; // Write image to barcode _writer.WriteBarcode(_image, _qrData, _options); // Save image using (RasterCodecs codecs = new RasterCodecs()) codecs.Save(_image, @"FILE PATH TO OUTPUT IMAGE", RasterImageFormat.Png, 0); }Sachin SinghRank #66 · 26.2K reputationPosted Feb 5, 2021, 1:05 AM EST
Abhishek YadavRank #217 · 11.3K reputationPosted Nov 21, 2022, 11:20 AM EST
For more information, you can visit this documentation:
https://www.e-iceblue.com/Tutorials/Spire.Barcode/Spire.Barcode-Program-Guide/Create-a-QR-Code-in-C.html