tags:

views:

30

answers:

2

Here is the code I'm calling

        PropertyInfo targetColumn;
        targetColumn = targetType.GetProperty("CtrId");

Here is the Class

using System;
using System.Runtime.Serialization;
using System.Xml.Serialization;

namespace JCDCHelper.CV
{
    [DataContract, Serializable]
    public class CenterAllActiveCV
    {
        [DataMember]
        [XmlElement( DataType = "long" )]
        public Int64 CtrId { get; set; }

        [DataMember]
        [XmlElement( DataType = "string", IsNullable = true )]
        public string Name { get; set; }

    }
}

I'm expecting targetColumn to be a valid PropertyInfo, but I'm getting null.

Am I missing something obvious?

Thanks,

Eric-

A: 

I was able to run your code just fine. How are you getting a Type reference?

Type targetType = typeof(CenterAllActiveCV);
var property = targetType.GetProperty("CtrId");

This worked for me...

Dismissile
A: 

Weird,

I recreated the CV file from scratch, and it works perfectly now. I guess I'll chalk it up to "invisible characters" in the CV...

Always leaves me wtih an unsettled feeling. :)

Cal-

Eric Brown - Cal
Forgot to say THanks!
Eric Brown - Cal