How can i select the top 5 records from a DataView which contains all records in descending order?
<p>This is my code:</p>

<pre><code>DataSet dsCategoryRes = new DataSet();
dsCategoryRes = oCourse.SubscribedResources(Profile.UserName, CustomerId, "0", 0);
DataTable dt = dsCategoryRes.Tables[0];
DataView dv = new DataView(dt);


Int32 maxCnt;
if (dv.Table.Rows.Count &lt;= 5)

    maxCnt = dv.Table.Rows.Count - 1;

else

    maxCnt = 4;
int cnt;
for (cnt = 0; cnt &lt;= maxCnt; cnt++)
{

    dv.Sort = "CategoryName DESC";
    //dv.Table.Rows.Cast&lt;System.Data.DataRow&gt;().Take(5);

    dt = dv.ToTable();
    dt.Rows.Cast&lt;System.Data.DataRow&gt;().Take(5);
    rptSub.DataSource = dt;


    rptSub.DataBind();
}
</code></pre>

<p>Using this am to able to sort in descending order but i am not able to select the top 5 values. </p>
