concatenate results of one column based upon distinct values of another column
<pre><code>I am trying to do this


col1  col2  col3

a       1     b

a       2     c

a       3     d
</code></pre>

<p>changes to</p>

<pre><code>col1 col2 col3

a    1   b, c, d

     2    

     3    
</code></pre>

<p>both col1 and col3 has text values</p>

<p>I wrote this code,  what is wrong with this code?  Anyone?</p>

<pre><code>DataSet ds = new DataSet();

using (var mm = new OracleDataAdapter(objCmd))
            mm.Fill(ds, "TableName");
            objCmd.Dispose();

DataView dv = ds.Tables["TableName"].DefaultView;

DataTable dt = ds.Tables["SURVEY_MASTER"];

 IEnumerable&lt;string&gt; query = (from row in dt.AsEnumerable()
                              select row.Field&lt;string&gt;("Col1")).Distinct();

 this.GridView1.DataSource = query;
</code></pre>

<p>This code above is not working.......I am trying to change</p>

<p>either ds or datatable values and then to display it</p>

<p>in gridview</p>

<p>Whats wrong with the code?</p>

<p>Anyone have simple solution of what i am trying to achieve?</p>

<p>Please do write full code, if possible</p>
