Everything seems correct. I tested console and Windows Forms with output to TextBox. Check your connection string.
Update: Just add exception handling
Try
...
Catch SqlExceptionErr As SqlException
'Write the exception
Console.WriteLine(SqlExceptionErr.Message)
Catch InvalidOperationExceptionErr As InvalidOperationException
'Write the exception
Console.WriteLine(InvalidOperationExceptionErr.Message)
End Try