Why doesn't the following command compile in VB.NET?
Dim strTest As String If (strTest.IsNullOrEmpty) Then MessageBox.Show("NULL OR EMPTY") End if
IsNullOrEmpty is "generic", so you should use it this way:
If String.IsNullOrEmpty(strTest) Then
In fact, you can simply compare with an empty string:
If strTest = "" Then MessageBox.Show("NULL OR EMPTY") End If
String.IsNullOrEmpty is a generic (or static, in C #) method.
Dim strTest As String If (String.IsNullOrEmpty(strTest)) Then MessageBox.Show("NULL OR EMPTY") End if