Dave, How about
Nullable.GetUnderlyingType(Type nullableType) ? HTH // Ryan On 10/2/06, Davy J <[EMAIL PROTECTED]> wrote:
Hi, I've got a java webservice that is returning objects , I need to create a database table to store these objects analysis and further processing. However, the webservice is returning Nullable types, how do I get the base type from the Nullable type using reflection.. foreach(PropertyInfo pi in pinfo) { sb.Append(pi.Name); sb.Append(" "); string typename = pi.PropertyType.Name; switch(typename) { sb.Append(pi.Name); //Used for the name of the table sb.Append(" "); string typename = pi.PropertyType.Name; // The reflected type, "String" switch(typename) { Normal non nullable types have a correct type in the object, but the nullable types I can either get System.Nullable or System.ValueType from the PropertyInfo object. I notice that in PropertyInfo.FullName it contains the underlying type, how can I get this without using string parsing to get it? this is the first of 120 objects to convert and process. cheers Dave, -- Dave Jones b1xml2 : "The one thing that is differentiates VB.NET from C# is the horrible ability to do this turn Option explicit and strict off, after which VB.NET can resemble mangled spaghetti. " =================================== This list is hosted by DevelopMentor(r) http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com
=================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com