Custom Class Property - Dynamic Reference
<p>I have a set of custom class properties - each property is named the same as values in a database. What I would like to do is dynamically set the value for each property based on a switch.</p>

<p>The custom properties look something like this:</p>

<pre><code>    class MyDEF
{

    #region Variable Declaration Section....

    private string _ABC01;
    private string _ABC02;
    private string _ABC03;
    private string _ABC04;

     #endregion 

    #region Property Declaration Section

    public string ABC01
    {
        get { return _ABC01; }
        set { _ABC01= value; }
    }

    public string ABC02
    {
        get { return _ABC02; }
        set { _ABC02= value; }
    }

    public string ABC03
    {
        get { return _ABC03; }
        set { _ABC03= value; }
    }

    public string ABC04
    {
        get { return _ABC04; }
        set { _ABC04= value; }
    }

   #endregion
 }
</code></pre>

<p>Then the code loading in the values looks something like:</p>

<pre><code>    foreach (DataRow dr in dataTable.Rows)
            {
                ED = dr["FieldDesc"].ToString();

     switch (ED)
     {
                            case "ABC01":
                                ratesVO.ABC01 = dr["DefaultValue"].ToString();
                                break;
                            case "ABC02":
                                ratesVO.ABC02 = dr["DefaultValue"].ToString();
                                break;
                            case "ABC03":
                                ratesVO.ABC03 = dr["DefaultValue"].ToString();
                                break;
                            case "ABC04":
                                ratesVO.ABC04 = dr["DefaultValue"].ToString();
                                break;
     }
    }
</code></pre>

<p>What I want to achieve is something like:</p>

<pre><code>    foreach (DataRow dr in dataTable.Rows)
    {
                ED = dr["FieldDesc"].ToString();
                MyCustomProperty.ED = dr["DefaultValue"].ToString();
    }
</code></pre>

<p>Is this possible? If so please provide an example or reference.</p>
