You need to check the value of the variable and assign System.DBNull.Value to the sql parameter value, not the variable. e.g.
Dim customerName As String = String.Empty
Dim prm As New System.Data.SqlClient.SqlParameter("@name", SqlDbType.VarChar, 50);
If customerName = String.Empty OrElse customerName Is Nothing
prm.Value = System.DBNull.Value
Else
prm.Value = customerName
End If
Developers usually create a specific class for converting to and from null values when reading resultsets and setting parameters.
Hope this helps