Thursday, 9 March 2017

Monday, 6 March 2017

ASP.NET 4.5 Web Forms Code Generator

Generate ASP.NET 4.5 Web Forms, Middle-Tier, Data-Tier, and Stored Procedures (or Dynamic SQL) in One Click*. AspxFormsGen 4.5 generates databound ASP.NET 4.5 web forms. AspxFormsGen 4.5 is a combination of our AspxFormsGen 4.5 engine (generates ASP.NET web forms) and AspxCodeGen 4.5 engine which generates Middle-Tier, Data-Tier, and Stored procedures or Dynamic SQL codes more...


Thursday, 23 February 2017

Remote Server Hangs on Startup

Computer showing the "Applying Group Policy..." and does nothing else on Windows startup. To resolve the issue, restart IIS remotely and enforce group policy:

IISRESET <computer-name> /restart
INVOKE-COMMAND -ComputerName <computer-name> { GPUPDATE /force } 


Setup Connection to new Remote SQL Server

After installing the new instance of SQL Server, the remote user might not be able to login remotely while can as local SQL user. To resolve this issue, follow the link more...


Wednesday, 22 February 2017

Open a Bootstrap Modal on Another Bootstrap Modal

<!DOCTYPE html>
<html lang="en">
  <head>
    <title></title>
    <meta charset="utf-8">
    <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
  </head>

<body>
  <!-- Button for test -->
  <button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#test1">Open First Modal</button>

  <!-- Modal 1 -->
  <div id="test1" class="modal fade" role="dialog" style="z-index: 1200;">
    <div class="modal-dialog">
      <!-- Modal content-->
      <div class="modal-content">
        <div class="modal-body">
          <button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#test2">
            Open Second Modal
          </button>
        </div>      
      </div>
    </div>
  </div>

  <!-- Modal 2 -->
  <div id="test2" class="modal fade" role="dialog" style="z-index: 1600;">
    <div class="modal-dialog">
      <!-- Modal content-->
      <div class="modal-content">  
        <div class="modal-body">
          Your content comes here
        </div>      
      </div>
    </div>
  </div>

</body>
</html>


Tuesday, 21 February 2017

C# .NET Get the List of Elements Which are in List1 but not in List2 and Vice Versa

// define the lists
List<string> list1 = new List<string>() { "a", "b", "c", "d", "e", "zz","ZZ" };
List<string> list2 = new List<string>() { "ZZ", "H","b" };

// convert the list elements to lowercase
list1 = list1.Select(x => x.ToLower()).ToList();
list2 = list2.Select(x => x.ToLower()).ToList();

// create desire lists
List<string> ItemsInList1NotInList2 = list1.Except(list2).ToList();
List<string> ItemsInList2NotInList1 = list2.Except(list1).ToList();


Sunday, 19 February 2017

Convert HTML to PDF in .NET

1. Download HtmlRenderer.PdfSharp Nuget packages: more...
Install-Package HtmlRenderer.PdfSharp -Version 1.5.0.6

2. Create a method in C# to convert html to pdf
public static void CreatePdfFromHtml (string html)
{
    Byte[] res = null;
    using (MemoryStream ms = new MemoryStream())
    {
var pdf = TheArtOfDev.HtmlRenderer.PdfSharp.PdfGenerator.GeneratePdf (html, PdfSharp.PageSize.A4);
pdf.Save(ms);
res = ms.ToArray();
    }
    File.WriteAllBytes("c:\\output.pdf", res);
}


Analysis Service in Power BI Report Server

 We couldn’t connect to the Analysis Services server. Make sure you’ve entered the connection string correctly... link