Browse by Tags
All Tags »
.Net Framework »
DEV (
RSS)
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...
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...
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 technical books...
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...
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...
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 dll of kernel32.dll with the method signature for Beep which...
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 ShouldSerialize PropertyName 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 classes. An example of use: public string Text { get; set; } public bool ShouldSerializeText...
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 small possibility of getting two identical hashes to two different strings. It is very useful for storing passwords...
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 chance in doing so. I needed much more time to solve the problem with a proper solution. Meanwhile, the client’s customer wanted results...
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 to thank all the participants of the session . I really had a good time presenting the frameworks. Also,...
Enum-Based Dictionaries and the Boxing Issue While reading today one of Ayende Rahien ( Oren Eini ) posts - Dictionary<Enum,T> Puzzler – I have learned a new issue regarding enum-based dictionaries . Apparently, the use of enums as the keys for a dictionary makes us pay in performance. The reason for that is that enums don’t implement IEquatable<T> . Because of that when we use enum-based dictionaries the comparing of keys will be performed by the ObjectComparer and we will have...
Back to Basics – Master Pages and Content Page Events The post is going to explain the concept of master page events during the page life cycle. The Problem Sometimes I get asked by colleagues when events occur during the page life cycle. This question is a very basic but very important thing to know. The problem starts when master pages are involved. Which event happens before which event? In what order events occur? This is going to be answered in the next section. Master Pages and Content Page...
Back to Basics – Zip in .NET In today’s post I’m going to share a problem I solved this week. The solution was to use the framework’s System.IO.Compression namespace and the GZipStream object. The Problem In my current project we save Xml data in our database. The field to save the data was of type varchar(6000). This way of saving the data raised a problem of big Xml data (over 8000 kb for every Xml data) which were saved in the database and for the long run could raise space and performance problems...
My Current Learning List of Technologies In the last few days I have started to learn few old/new technologies that I think you should consider learning in the near future as well (if you didn’t learn them before). The technologies: ASP.NET MVC Framework – the new framework that leverage the MVC pattern for ASP.NET. The technology is a must learn technology for every .NET web developer in my opinion. Learning the framework will give you a new choice for implementing web applications with MVC pattern...
Getting Started with Microsoft Sync Framework The post will introduce the Microsoft Sync Framework which, in my opinion, is going to be one of the must know technologies of the near future. What is Microsoft Sync Framework? Microsoft Sync Framework is a synchronization platform that enables collaboration and offline access across multiple data stores. The framework enables taking data offline by working against a cached set of data. Then we can submit the changes to a global database in a batch by...
More Posts
Next page »