I wrote previously a post where I combine 2 Lists together here. Recently, I had the requirement to join 2 dictionaries together. I needed to build a DataTable and an NHibernate HQL query dynamically where the column headings could be different than the name of the actual database column name. To do this I created […]
Read More →Create an exe executable and hide the console window using C#
I needed to create an executable which would run as a job triggered from a scheduler. I decided to create a Console application, using, of course C#. I wanted it to run without the Console window popping up. I asked myself, how do I stop the console window from popping up or how do I […]
Read More →How and why I built a cluster of Raspberry Pi’s (Part 2)
Have a read of Part 1 here if you are stumbling across this article first. The reason I built this cluster of Raspberry Pi’s is to learn. And I can say from the start I have learned a few things. If you take a quick historical look at computing, it started with procedural coding paradigms. […]
Read More →Configure the IIS Application Initialization module
During my many years of active IIS administration which hosted ASP.NET application, we had many discussions about why the first request to the web site took longer than those coming after. In short, it’s because the first request, after a restart of the process results in a recompilation of the temporary ASP.NET files. In complicated, […]
Read More →Capture textbox enter key event using C#
The other day I needed to implement a search function in a WPF program. I wanted the use to be able to enter the criteria and then the enter key to perform the search. I achieved this by adding a KeyDown event to the text box control in the XAML. KeyDown=”textBox1_KeyDown” And adding the below […]
Read More →Different return type from a method of a derived class
In .NET Framework 4, C# supports covariance and contravariance in generic interfaces and delegates. However, if you try to implement either in a class, you will receive an exception. Trying to implement covariance in a return type or overriding a method and attempting to return a different type will not work. Let’s discuss below. public […]
Read More →Generic Type Parameters parameter interface c#
I liked this concept because it seems kind of sneaky. By that I mean, in the past I was only able to call a method from a base class via inheritance or creating an instance of the class itself. However, now by implementing a generic type parameter we can achieve the same thing. First we […]
Read More →Generic Interface with a type constraint in C#
In a previous blog I discussed how to use and implement an interface with generics. I decided shortly after that it would be a good idea, in my context, to loosely bind a type to the interface. In the previous blog, it was left 100% generic and that was fine for the example. However, there […]
Read More →How to convert Dictionary keys or values to a List
I once had a requirement that I needed to dynamically build a select statement, based on a users selection and then display the results in a DataGrid. The tricky part was that the column name in the select portion of the query was not always the name I needed to show as the column heading […]
Read More →Simplified Deployment
DLL Hell. Enough said, well maybe not. Before .NET every installation of a new version of a program or the installation of any program was a gamble. There was always a risk that a necessary component required to run the new version would overwrite a component which is used by another causing the old program […]
Read More →