<p>I'm attempting to create a dataset based on the properties of an object. For example, I have an instance of a Person class with properties including ID, Forename, Surname, DOB etc. Using reflection, I'm adding columns to a new dataset based on the object properties:</p>

<pre><code>For Each pi As PropertyInfo In person.GetType().GetProperties()
    Dim column As New DataColumn(pi.Name, pi.PropertyType)
    table.Columns.Add(column)
Next
</code></pre>

<p>My problem is that some of those properies are nullable types which aren't supported by datasets. Is there any way to extract the underlying system type from a nullable type?</p>

<p>Thanks.</p>

I'm guessing that the problem is recognizing whether the property is nullable or not. In C# you do this with this code:
```
```
if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>))
```
```
... but I'm not sure what the equivalent of that last clause is in VB.NET.