Thursday, 18 January 2018

Windows 10 StopCode - Rebooting on Startup

Windows 10 StopCode - Rebooting on Startup and cannot restore, re-install, etc. To fix this issue:
  • Boot from a bootable media
  • On start-up, go to Troubleshoot, Advance options, and open the Command Prompt
  • Change the drive to Windows drive
  • Issue the following commands:
    • cd windows\system32\config
    • md backup
    • copy *.* backup
    • cd regback
    • copy *.* ..

Than exit and restart the system... more


Wednesday, 17 January 2018

Create PDF from HTML using NReco.PdfGenerator with page number

var htmlToPdf = new NReco.PdfGenerator.HtmlToPdfConverter();
htmlToPdf.PageFooterHtml = @"<div style='text-align:right; font-size:14px;'>Page <span class=""page""></span> of &nbsp;<span class=""topage""></span><div>";
htmlToPdf.Margins.Top = 15;
htmlToPdf.Margins.Bottom = 15;
htmlToPdf.Margins.Left = 8;
htmlToPdf.Margins.Right = 8;

var pdfBytes = htmlToPdf.GeneratePdf(HtmlFile);
File.WriteAllBytes(newpath, pdfBytes);


SQL: Generate a range of numbers

SELECT ones.n + 10*tens.n + 100*hundreds.n + 1000*thousands.n FROM       (VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9)) ones(n),      (VALU...