Select ONE record with details from that record...http://forums.asp.net/t/1769082.aspx/1?Select+ONE+record+with+details+from+that+record+Wed, 15 Feb 2012 00:45:23 -050017690824830317http://forums.asp.net/p/1769082/4830317.aspx/1?Select+ONE+record+with+details+from+that+record+Select ONE record with details from that record... <p>Hello,</p> <p>I am trying to select an order from the database and then get that order's details. I have a table with all the orders (order #) in it and there is one row/record per order. THen I have another table I am joining to, bu order #, with the order's details. I want to use that with a CollapsablePanel extender, by showing the details when you click on that record. The problem is: when I do the join, I obviously get a bunch of records that come back, but the I only want to use the order number, first name, last name et cetera to show up ONCE in the &quot;HeaderPanel&quot; of the collapsable extender. HOw would I go about doing something like this?</p> <p>~D</p> 2012-02-13T18:10:37-05:004830330http://forums.asp.net/p/1769082/4830330.aspx/1?Re+Select+ONE+record+with+details+from+that+record+Re: Select ONE record with details from that record... <p>For the fields that you only want to appear once, use the data from the first row of your query results.</p> 2012-02-13T18:24:00-05:004830508http://forums.asp.net/p/1769082/4830508.aspx/1?Re+Select+ONE+record+with+details+from+that+record+Re: Select ONE record with details from that record... <p>&nbsp;use &quot;Distinct&quot; word in your sql query and see if that helps...</p> <p></p> <p>select distinct OrderNumber, FirstName, LastName...</p> 2012-02-13T21:36:59-05:004832533http://forums.asp.net/p/1769082/4832533.aspx/1?Re+Select+ONE+record+with+details+from+that+record+Re: Select ONE record with details from that record... <p></p> <blockquote><span class="icon-blockquote"></span> <h4>donato1026</h4> but the I only want to use the order number, first name, last name et cetera to show up ONCE in the &quot;HeaderPanel&quot;</blockquote> <p></p> <p>Besides using distinctyou can also use DataView.ToTable's 3rd function with a string[]this will filter duplicated issues</p> <pre class="prettyprint">using(SqlDataAdapter adapter = new SqlDataAdapter(&quot;select * &quot;,&quot;conn str&quot;)) { DataTable dt = new DataTable(); adapter.Fill(dt); DataView dv = new DataView(dt); dt = dv.ToTable(true,&quot;field1&quot;,&quot;field2&quot;,,&quot;fieldN&quot;); }</pre> <p></p> 2012-02-15T00:45:23-05:00