lundi 16 novembre 2015

Identify specific nullable type

I have a function which for a given object loop through its properties (of several datatypes), but when i added one with the type SqlDateTime? i get an invalid cast exception. Here is the part

 If Nullable.GetUnderlyingType(prop.PropertyType) <> Nothing Then
    Dim cad As SqlString? =  cad = prop.GetValue(obj)

It fails because in the past the only nullable type was SqlString?, so i would like to know with wich specific type of nullable(SqlString?, SqlDateTime?, etc) i am dealing with.





Aucun commentaire:

Enregistrer un commentaire