Back to Basics – Null-Coalescing Operator

Thursday, November 18, 2010

Back to Basics – Null-Coalescing Operator Yesterday during an EF4 course that I’m giving at a customer I showed an example for a property that is set using the null-coalescing operator. Since some of the students asked me what is this operator, I gave a small explanation and thought that it’s something that I can share here in the blog. So here it goes… Null-Coalescing Operator The null-coalescing operator or ?? can be very useful when you want to check nullity of a reference type or nullable types. When it is used, it returns the left-hand...
no comments

Using .Net WCF Syndication API to Read a Comments Feed

Sunday, August 15, 2010

Using .Net WCF Syndication API to Read a Comments Feed In the last few days I have started a migration process to my own domain  – www.gilfink.net. Currently this domain is redirecting to this blog but in the near future I’ll move my blog to there. I’ll keep publishing in this blog along with the new one so don’t worry. One of the biggest problems I got stuck with was that this blog community server doesn’t include an export feature like in other blog platforms like BlogEngine.Net. So I’m currently building a migration tool to...
no comments

Book Review – C# in Depth – What You Need to Master C# 2 and 3

Thursday, April 15, 2010

Book Review – C# in Depth – What You Need to Master C# 2 and 3 In the last weeks  I read the book “C# in Depth – What You Need to Master C# 2 and 3” that was written by Jon Skeet. You might ask yourself why I bothered reading a book about C# 2 and 3. The answer is very simple.  Knowing some material isn’t enough and reading leads to wide and deeper knowledge. One of the first things that I recommend people who ask me how can I learn and gain programming knowledge is reading good...
no comments

Invoking Javascript From a WebBrowser Control

Thursday, March 25, 2010

Invoking Javascript From a WebBrowser Control Today I got a request to use A WebForms application inside a WinForms application. One problem that we needed to solve was how to make an interaction between the WinForm and the WebForm it uses. The post will show the solution. Invoking Javascript From a WebBrowser Control When you want to use a WebForm within a WinForms application you should use the WebBrowser control. Taken from MSDN the WebBrowser control “Enables the user to navigate Web pages inside your form.”. One of the nice features of the WebBrowser control is its ability to invoke Javascript. On...
no comments

Performing Queries Against Active Directory Domain Services

Wednesday, March 3, 2010

Performing Queries Against Active Directory Domain Services One of the missions that needed my attention lately was to check whether a user exists in an enterprise Active Directory. The post will show exactly how to perform such a query. The DirectoryEntry Class The DirectoryEntry class represent an entry in Active Directory. That entry live in memory when created and changes that you perform on it won’t be submitted to Active Directory unless you call the CommitChnages method. That class can be found in System.DirectoryServices namespace. The following code shows how to create a DirectoryEntry object using a the path to the LDAP,...
no comments

Quick Tip – Making Beep From the PC Speaker Using P/Invoke

Friday, February 26, 2010

Quick Tip – Making Beep From the PC Speaker Using P/Invoke I was asked yesterday how can we perform a beep sound from the PC speaker. This is  something that is needed in one of the  applications that I’m consulting for to indicate a successful transaction (don’t ask me way…).  Setting the Environment We first need to add the using for Runtime.InteropServices: using System.Runtime.InteropServices; Then load the unmanaged...
2 comments

Quick Tip – Using the ShouldSerializeXXX methods

Wednesday, September 2, 2009

Quick Tip – Using the ShouldSerializeXXX methods Something that I encountered last week. The ShouldSerialize methods are optional methods that you can provide for a class property. These methods are built as ShouldSerializePropertyName and inside of them you can provide a check that will determine whether the property should be serialized or not. Of course this can be achieved only in serializable...
no comments

Back to Basics – Calculating MD5 Hashing

Back to Basics – Calculating MD5 Hashing Yesterday I needed to use a hashing algorithm for a given task. I chose to use the MD5  hashing algorithm and in this post I’ll show how to calculate MD5 hash from a given string. What is MD5 Hashing Algorithm? MD5 is a very widely used hashing function that commonly used to check the integrity of files or strings. When using MD5 There is a ...
no comments

Back to Basics – ASP.NET Page State Persister

Tuesday, April 28, 2009

Back to Basics – ASP.NET Page State Persister Yesterday I was consulting at a client. The main problems that the client currently has are performance issues. One of the problems I found was the abuse of ViewState without knowing the consequences. I was trying to reduce the ViewState for the pages and because of the spaghetti code of the client’s application I had no...
2 comments

Start Thinking with ADO.NET 3.5 Slide Deck

Monday, March 2, 2009

Start Thinking with ADO.NET 3.5 Slide Deck Yesterday I had an ADO.NET  3.5 session in the The Israeli Web Development Community (WDC). The session agenda: Entity Framework ADO.NET Data Services Datasets Enhancements  As promised, the slide deck and demos can be downloaded from here. I want to thank Noam King for the opportunity to lecture in WDC. it was a pleasure. Also, I want...