This past week a very old (last time I did work for him was in 2007) client of mine contacted me because their program suddenly started exhibiting a problem. It seems that if a user enters a date anytime in 2015, the program displays an error message indicating that they need to enter a date greater than today and less than two years from today.
When I went to replicate the error in my debugger, I discovered this bit of code:
Continue reading “Magic Strings and Magic Numbers”
Podcast: Play in new window | Download
SQL has long had the ability to specify that a value is NULL even if it is a primitive type, but the only way you could have a NULL value in VB.NET is if you were dealing with an object.
That is, until .NET 2.0
Even though .NET 2.0 has been out for a while, I would bet that few VB.NET programmers know about this new feature because it is one of those things most of us have grown to assume is not possible.
Values must have content–objects don’t. That’s just the way it is.
Continue reading “VB.NET Nullable Types”
I woke up this morning to an interesting question.
“Using VB.net 2008, I want my project to be a Windows Forms Application, but upon startup, I want to check a few files to see if they exist and if they don’t I do not want the startup form to load. I just want the program to quit. If you have to start this type of application with a form, how do you keep the form from displaying?”
Continue reading “VB.NET Processing Before WinForm Display”
Typically when we write our code, the event handlers get wired up for us using the handles clause. So we never have to worry about wiring up our event handlers manually.
But what about the case where we want to dynamically add a control to our Windows Form or our ASP.NET page? For example, add a button. How would you respond to the button click event?
Continue reading “Manually Adding Event Handlers in VB.NET”