"Cor Ligthert [MVP]" <notmyfirstname@planet.nl> wrote in message
news:e054qGkgHHA.1216@TK2MSFTNGP03.phx.gbl...
>
http://msdn2.microsoft.com/en-us/library/h2b6ehaa.aspx >
>
> "Doug Bell" <dug@bigpond.com> schreef in bericht
> news:O91LyvhgHHA.3412@TK2MSFTNGP02.phx.gbl...
> > Cor, Please enlighten me.
> >
> > "Cor Ligthert [MVP]" <notmyfirstname@planet.nl> wrote in message
> > news:egmXDxdgHHA.4924@TK2MSFTNGP06.phx.gbl...
> >> Doug
> >>
> >> You know that it is a standard overloaded method from 2.0
> >>
> >> Cor
> >>
> >> "Doug Bell" <dug@bigpond.com> schreef in bericht
> >> news:uADgWgdgHHA.2432@TK2MSFTNGP03.phx.gbl...
> >> >I solved the problem using a DataView to create the new Table.
> >> >
> >> >
> >> > "Doug Bell" <dug@bigpond.com> wrote in message
> >> > news:umg1encgHHA.4260@TK2MSFTNGP03.phx.gbl...
> >> >> Hi,
> >> >>
> >> >> I have a DataSet with a DataTable that has a number of duplicate
rows
> >> >> (except for one column that has a unique value).
> >> >>
> >> >> Each row has OrderNo, OrderLineNo, etc and there are multiple rows
> > with
> >> >> the same OrderNo and OrderLineNo.
> >> >>
> >> >> I need to display data in a DataGrid but displaying only one record
> >> >> for
> >> > each
> >> >> OrderNo OrderLineNo.
> >> >>
> >> >> I was thinking about constructing a new DataTable holding the Unique
> >> >> OrderNo-OrderLineNo records, something along the lines of code below
> > but
> >> >> I
> >> >> need to have the data ordered by 2 columns to do that.
> >> >>
> >> >> Any ideas or suggestions?
> >> >>
> >> >> Thanks, Doug
> >> >>
> >> >> Dim dt as DataTable = New DataTable
> >> >> dt = dsMyDataSet.Tables("MyDataTable").Clone
> >> >> Dim dr, drNew as DataRow
> >> >> Dim drs() as DataRow =
> > dsMyDataSet.Tables("MyDataTable").Select("PickList
> >> > =
> >> >> " & PickListNo, "OrderNo ASC") 'How can I sort on 2 Columns OrderNo
> >> >> and
> >> >> OrderLineNo
> >> >> Dim iOrd, iOrdLin as Integer
> >> >> Dim iCol as integer
> >> >> dim iCols as integer = dt.Columns.Count-1
> >> >>
> >> >> for each dr in drs
> >> >> If iOrd <> dr("OrderNo") and iOrdLin <> dr("OrderLineNo") Then
> >> >> drNew = dt.NewRow
> >> >> For iCol = 0 to iCols
> >> >> drNew(iCol) = dr(iCol)
> >> >> Next iCol
> >> >> dt.Rows.Add(drNew)
> >> >> Else
> >> >> iOrd = dr("OrderNo")
> >> >> iOrdLin <> dr("OrderLineNo")
> >> >> End If
> >> >>
> >> >> next dr
> >> >>
> >> >>
> >> >
> >> >
> >>
> >>
> >
> >
>
>