title: Setting/getting the class properties by string name
body: <p>What I'm trying to do is setting the value of the property in a class using a string.  For example, my class has the following properties:</p>
  
  <pre><code>myClass.Name
  myClass.Address
  myClass.PhoneNumber
  myClass.FaxNumber
  </code></pre>
  
  <p>All the fields are of <code>string</code> type so I know ahead of time that it's always a string.  Now, I want to be able to set the properties using a string as you could do with a <code>DataSet</code> object.  Something like this:</p>
  
  <pre><code>myClass["Name"] = "John"
  myClass["Address"] = "1112 River St., Boulder, CO"
  </code></pre>
  
  <p>Ideally, I want to just assign a variable and then set the property using that string name from the variable:</p>
  
  <pre><code>string propName = "Name"
  myClass[propName] = "John"
  </code></pre>
  
  <p>I was reading about reflection and maybe it's the way to do it but I'm not sure how to go about setting that up while keeping the property access intact in the class.  I want to still be able to use:</p>
  
  <pre><code>myClass.Name = "John"
  </code></pre>
  
  <p>Any code examples would be really great.</p>