DefaulView.Sort enumerating rows not sorted????

DefaulView.Sort enumerating rows not sorted????

Post by GreekToM » Fri, 28 Jun 2002 12:21:59



I want to sort my dataset table before I process the rows in the table
but how can I enumerate through the rows in the table in the order I have
set the defaultview.sort?

Here is some code as an example:

DataTable aTable = DS.Tables[0];

DS.Tables["Table"].DefaultView.Sort = "PPOSetDescription ASC,
RimsDocumentNumber ASC";

aTable = DS.Tables["Table"];

foreach( DataRow DRow in aTable.Rows)

{

// the sort order is not as was set in the defaultview.sort

Quote:}

 
 
 

DefaulView.Sort enumerating rows not sorted????

Post by Andy Baro » Fri, 28 Jun 2002 14:34:26


Try:
foreach( DataRowView DRow in aTable.DefaultView)

 -- Andy


Quote:>I want to sort my dataset table before I process the rows in the table
>but how can I enumerate through the rows in the table in the order I have
>set the defaultview.sort?

>Here is some code as an example:

>DataTable aTable = DS.Tables[0];

>DS.Tables["Table"].DefaultView.Sort = "PPOSetDescription ASC,
>RimsDocumentNumber ASC";

>aTable = DS.Tables["Table"];

>foreach( DataRow DRow in aTable.Rows)

>{

>// the sort order is not as was set in the defaultview.sort

>}


 
 
 

DefaulView.Sort enumerating rows not sorted????

Post by GreekToM » Sun, 30 Jun 2002 02:09:24


Thanks.   I got it before I read your response.


> Try:
> foreach( DataRowView DRow in aTable.DefaultView)

>  -- Andy


> >I want to sort my dataset table before I process the rows in the table
> >but how can I enumerate through the rows in the table in the order I have
> >set the defaultview.sort?

> >Here is some code as an example:

> >DataTable aTable = DS.Tables[0];

> >DS.Tables["Table"].DefaultView.Sort = "PPOSetDescription ASC,
> >RimsDocumentNumber ASC";

> >aTable = DS.Tables["Table"];

> >foreach( DataRow DRow in aTable.Rows)

> >{

> >// the sort order is not as was set in the defaultview.sort

> >}