An implementation of Visual Basic that is built into Microsoft products.
If this is VB.NET, Convert.ToInt32() normally exists. If you're getting “ToInt32 is not a member of Convert”, the most likely issue is that Convert is resolving to something other than System.Convert.
Try explicitly qualifying it:
If countObj IsNot Nothing AndAlso System.Convert.ToInt32(countObj) > 0 Then
' ...
End If
If countObj is a database value
If it can contain DBNull.Value, use:
If countObj IsNot Nothing AndAlso
Not Convert.IsDBNull(countObj) AndAlso
Convert.ToInt32(countObj) > 0 Then
' ...
End If
Or, more robustly:
Dim count As Integer = If(countObj Is Nothing OrElse Convert.IsDBNull(countObj),
0,
Convert.ToInt32(countObj))
If count > 0 Then
' ...
End If
If System.Convert.ToInt32(countObj) also gives the same error then what is the declaration/type of countObj and the exact error message? There's likely a naming conflict with Convert.