Category Archives: VB.Net

.Net Implicit Casts

Casts A cast is a conversion of data from one type to another, for example from an integer to a float. Implicit Casts An implicit cast is a conversion from one type to another that is automatically assumed by the … Continue reading

Posted in C#, VB.Net | Leave a comment

VB.Net: Determine if an Object or Class Implements an Interface

The Problem You want to know if a class called MyClass implements interface IMyInterface, or the object myObject inplements interface IMyInterface. Unfortunately, you can’t do: [sourcecode language=”vb”] If MyClass Is IMyInterface Then ‘ Something… End If [/sourcecode] The Solution It … Continue reading

Posted in VB.Net | 1 Comment

More .Net Cheat Sheets

I have linked a few before. There are more here:

Posted in ASP.Net, Programming, VB.Net | Leave a comment

Subtle Bug: VB.Net Dim Statement

Here is a question for you – are the following pieces of code equivalent? Declaration followed by Explicit Initializer [sourcecode language=”vb”] Dim b As Boolean b = False Console.WriteLine(b.ToString) [/sourcecode] Declaration with Implicit Implicit Initializer [sourcecode language=”vb”] Dim b As … Continue reading

Posted in VB.Net | Tagged | 2 Comments

GridView Buttons not Working?

In my experience, the most common reason for Buttons in a GridView not working is that data is being bound to the GridView during the postback. In other words, the code looks something like this: [sourcecode language=”VB”] Protected Sub Page_Load(ByVal … Continue reading

Posted in ASP.Net, VB.Net | Leave a comment