 




<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: get value from column using a column name string</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/get-value-from-column-using-a-column-name-string/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/get-value-from-column-using-a-column-name-string/</link>
	<description></description>
	<lastBuildDate>Sat, 18 May 2013 07:52:31 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: The most-watched IT questions: April 2, 2012 - ITKE Community Blog</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/get-value-from-column-using-a-column-name-string/#comment-106350</link>
		<dc:creator>The most-watched IT questions: April 2, 2012 - ITKE Community Blog</dc:creator>
		<pubDate>Mon, 02 Apr 2012 15:53:31 +0000</pubDate>
		<guid isPermaLink="false">#comment-106350</guid>
		<description><![CDATA[[...] 6. Add your insight into solving how to get a value from a column in Visual Studio. [...]]]></description>
		<content:encoded><![CDATA[<p>[...] 6. Add your insight into solving how to get a value from a column in Visual Studio. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ozvenison</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/get-value-from-column-using-a-column-name-string/#comment-105192</link>
		<dc:creator>ozvenison</dc:creator>
		<pubDate>Wed, 21 Mar 2012 06:58:05 +0000</pubDate>
		<guid isPermaLink="false">#comment-105192</guid>
		<description><![CDATA[the line    value = v.GetType().GetProperty(m.ColumnName).GetValue(v, null);
 was were I was &#039;experimenting&#039;]]></description>
		<content:encoded><![CDATA[<p>the line    value = v.GetType().GetProperty(m.ColumnName).GetValue(v, null);<br />
 was were I was &#8216;experimenting&#8217;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ozvenison</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/get-value-from-column-using-a-column-name-string/#comment-105191</link>
		<dc:creator>ozvenison</dc:creator>
		<pubDate>Wed, 21 Mar 2012 06:55:10 +0000</pubDate>
		<guid isPermaLink="false">#comment-105191</guid>
		<description><![CDATA[at the moment I have to &#039;hard code&#039; via a switch statement for each table and column names.. this if course will not work when the users add other tables... here is sample:
&lt;pre&gt;
            List&lt;SpreadMappings&gt; spreadMapping = new List&lt;SpreadMappings&gt;();
            foreach (var m in mappings)
            {
                foreach (var v in hvalues)
                {
                    SpreadMappings map = new SpreadMappings();
                    value = v.GetType().GetProperty(m.ColumnName).GetValue(v, null);
                    switch (m.ColumnName)
                    {
                        case &quot;DocHeading&quot;:
                            map.ColumnX = m.ColumnX;
                            map.ColumnY = m.ColumnY;
                            map.ColumnValue = v.DocHeading;
                            map.ColumnName = m.ColumnName;
                            map.ColumnId = v.Id;
                            map.ColumnSheetName = sheetName;
                            spreadMapping.Add(map);
                        break;

                        case &quot;OrderCarryOverUnit1&quot;:
                            map.ColumnX = m.ColumnX;
                            map.ColumnY = m.ColumnY;
                            map.ColumnValue = v.OrderCarryOverUnit1;
                            map.ColumnName = m.ColumnName;
                            map.ColumnId = v.Id;
                            map.ColumnSheetName = sheetName;
                            spreadMapping.Add(map);
                        break;
&lt;/pre&gt;

Cheers]]></description>
		<content:encoded><![CDATA[<p>at the moment I have to &#8216;hard code&#8217; via a switch statement for each table and column names.. this if course will not work when the users add other tables&#8230; here is sample:</p>
<pre>
            List&lt;SpreadMappings&gt; spreadMapping = new List&lt;SpreadMappings&gt;();
            foreach (var m in mappings)
            {
                foreach (var v in hvalues)
                {
                    SpreadMappings map = new SpreadMappings();
                    value = v.GetType().GetProperty(m.ColumnName).GetValue(v, null);
                    switch (m.ColumnName)
                    {
                        case "DocHeading":
                            map.ColumnX = m.ColumnX;
                            map.ColumnY = m.ColumnY;
                            map.ColumnValue = v.DocHeading;
                            map.ColumnName = m.ColumnName;
                            map.ColumnId = v.Id;
                            map.ColumnSheetName = sheetName;
                            spreadMapping.Add(map);
                        break;

                        case "OrderCarryOverUnit1":
                            map.ColumnX = m.ColumnX;
                            map.ColumnY = m.ColumnY;
                            map.ColumnValue = v.OrderCarryOverUnit1;
                            map.ColumnName = m.ColumnName;
                            map.ColumnId = v.Id;
                            map.ColumnSheetName = sheetName;
                            spreadMapping.Add(map);
                        break;
</pre>
<p>Cheers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ozvenison</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/get-value-from-column-using-a-column-name-string/#comment-105190</link>
		<dc:creator>ozvenison</dc:creator>
		<pubDate>Wed, 21 Mar 2012 06:30:28 +0000</pubDate>
		<guid isPermaLink="false">#comment-105190</guid>
		<description><![CDATA[ok... 
what I am trying to do is get values from a table row to map the x,y cells of an excel sheet..

the first list contains the rows with Column_Name, yCord and yCord values (maplist)
The second list contains rows with the actual values... the number of columns varies depending on which table I am processing...

So, I loop through the 1st list and get a row from the spreadmaps,,, I then go through the second list and want to get the value from each row based on the column_name supplied from maplist... 

so v.&#039;column_name&#039;... ie v.date or v.openingBalance or v.closing balance..  where the column is based on what is supplied by the column_name string from spreadmaps

I need to be &#039;dynamic&#039; here as each sheet on the &#039;spread&#039; control ca be based on a different table and therefore column_names
Hope this makes sense..]]></description>
		<content:encoded><![CDATA[<p>ok&#8230;<br />
what I am trying to do is get values from a table row to map the x,y cells of an excel sheet..</p>
<p>the first list contains the rows with Column_Name, yCord and yCord values (maplist)<br />
The second list contains rows with the actual values&#8230; the number of columns varies depending on which table I am processing&#8230;</p>
<p>So, I loop through the 1st list and get a row from the spreadmaps,,, I then go through the second list and want to get the value from each row based on the column_name supplied from maplist&#8230; </p>
<p>so v.&#8217;column_name&#8217;&#8230; ie v.date or v.openingBalance or v.closing balance..  where the column is based on what is supplied by the column_name string from spreadmaps</p>
<p>I need to be &#8216;dynamic&#8217; here as each sheet on the &#8216;spread&#8217; control ca be based on a different table and therefore column_names<br />
Hope this makes sense..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: carlosdl</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/get-value-from-column-using-a-column-name-string/#comment-105174</link>
		<dc:creator>carlosdl</dc:creator>
		<pubDate>Tue, 20 Mar 2012 23:16:23 +0000</pubDate>
		<guid isPermaLink="false">#comment-105174</guid>
		<description><![CDATA[Please be a little more specific. 

What exactly do you need help with ?

Does your code work (at least partially) ?  Does it give errors ?
Where is the mlist and vlist declaration ?]]></description>
		<content:encoded><![CDATA[<p>Please be a little more specific. </p>
<p>What exactly do you need help with ?</p>
<p>Does your code work (at least partially) ?  Does it give errors ?<br />
Where is the mlist and vlist declaration ?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 6/9 queries in 0.012 seconds using memcached
Object Caching 324/327 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-18 08:12:20 -->