c# get attributes from object
<p>I'm a bit new to C# and I got this script that gets a record from a mssql database. There it converts the key to an object.</p>

<p>Its:</p>

<pre><code>Object obj = result[i];
</code></pre>

<p>When I enable a breakpoint on the line after the declaration I see the data that is inside the object. Now I need to access the attribute with the data but because Im a bit new to C# I dont know how to do that.</p>

<p>Lets say the attribute is called: name
I made a new class of my own also with the attribute name.</p>

<p>When I try to get the name of the key to my object with:</p>

<pre><code>myObject.Name = (string) obj.Name;
</code></pre>

<p>The IDE already gives an error that the attribute in the obj isnt available.</p>

<p>How can I access the name attribute of the object to get it to my own object?</p>

<p>Thanks!</p>
