Select Case True

This syntax is often used instead of an If…ElseIf statement. Some people find it a little easier to read. For example: Select Case True Case testVariable < 0 Console.Write(“You must supply a positive value.”) Case testVariable > 10 Console.Write(“Please enter a number from 0-10.”) Case True Call DoWork(testVariable) End Select The answer is that yes, … Read more

How can I get the WebClient to use Cookies?

Create a new class the inherits from WebClient that stores the CookieContainer like @Guffa says. Here’s code that I use that does that and also keeps the referer alive: Public Class CookieAwareWebClient Inherits WebClient Private cc As New CookieContainer() Private lastPage As String Protected Overrides Function GetWebRequest(ByVal address As System.Uri) As System.Net.WebRequest Dim R = … Read more

Installshield Custom Dialogue Installer

UAC Prompt: “If you Authenticode-sign your .msi package, Windows will show that as the name. Otherwise, you get MSI’s temporary copy of it, which has a random name.” (from Bob Arnson’s answer here (WiX developer & overall master of conciseness). So you need to get a digital code-signing certificate – if you don’t have one … Read more

handling dbnull data in vb.net

The only way that i know of is to test for it, you can do a combined if though to make it easy. If NOT IsDbNull(myItem(“sID”)) AndAlso myItem(“sID”) = sId Then ‘Do success ELSE ‘Failure End If I wrote in VB as that is what it looks like you need, even though you mixed languages. … Read more

How to create Control Arrays in VB .NET

Here is a sample I wrote for something else that shows how to do something similar and shows how to do the handler as well. This makes a 10×10 grid of buttons that turn red when you click them. Dim IsCreated(99) As Boolean Dim Buttons As New Dictionary(Of String, Button) Private Sub Form1_Load(ByVal sender As … Read more