Archive for the ‘Advanced CSharp’ Category

ASP.NET Substitution Control

G04B0063

Tucked away on the toolbar is a little-used and often overlooked control.  Not using this control could be costing you in performance.

The control I’m referring to is the Substitution control.  The only time you’d use it would be if you had implemented page caching.  You are using page caching, right?

Read the rest of this entry »

What is .NET’s Object.GetHashCode() Used For?

food-brk-02

Here is a great question from a visitor.

“What is the exact use of GetHashCode of an object in .net? Does it have any relation with garbage collection?”

Let’s answer the second question first. No, it has nothing to do with garbage collection.

Read the rest of this entry »

Dispose, Finalize and SuppressFinalize

food-drk-017

I got the following question recently.

What is the difference between Dispose and
SupressFinalize in garbage collection?”

The problem with this question is it assumes Dispose and SupressFinalize have similarities, which I’m sure is not what is being asked here.  So let’s rephrase it in terms that make sense.

I see three methods available to me in .NET that all seem to have something to do with garbage collection.  Can you explain what Dispose, Finalize, and SupressFinalize do and why I could use or call each one in my code?”

Read the rest of this entry »

Using VB.NET From CSharp

G08L0047 Back when I was teaching .NET to other programmers regularly, I would frequently get the following question from a VB6 programmer moving to CSharp.

“Is there any way of using some of the VB functions I’m used to using within CSharp?”

The answer to this question has two parts, which we will explore today.

Read the rest of this entry »

CSharp ?? Operator

One of the problems with learning a language early in its life cycle is that by the time version three comes out, you never look at or implement any of the new features.

There are two reasons for this.  First, the features you are using already cover 80% of the features you need.  Second, you never look at the manual to discover what new features are available–features that may help you write your code more efficiently.

The CSharp ?? operator is one such feature.

Read the rest of this entry »

DotNetNuke Sponsor

 

Most Valuable Blogger
Sponsor