Home All Groups Group Topic Archive Search About

Rank Dataset Contents

Author
22 May 2006 11:34 PM
Wayne Wengert
I have a VS2005/VB Windows application in which I want to rank the contents
of a "total" field in a dataset but I can't seem to figure out how to do
this. I've created an SQL DataAdapter and an SQL Dataset and I filled the
dataset with the values needed. The dataset has "n" rows and the columns
include "total" (a decimal value) and "rank" (an integer initially set to
zero). I want to place the ranking value (e.g. 1 through n) for each value
of "total" in the corresponding "rank" column and then write the updated
data back to the DB.
Any suggestions/pointers would be appreciated.

Author
23 May 2006 5:31 AM
Cor Ligthert [MVP]
Wayne,

Start with asking a question as correct as possible so we can understand
you. A dataset has no rows.

In the datatable you can create an extra column for your problem and than
use the defaultview to show it in the rank you want.

To show you the column and the expression
http://www.vb-tips.com/dbPages.aspx?ID=76a81eb8-ea2d-48f4-99c3-a3539697edbd

I hope this helps,

Cor

Show quoteHide quote
"Wayne Wengert" <wayneSKIPSPAM@wengert.org> schreef in bericht
news:uFhx%23gffGHA.1856@TK2MSFTNGP03.phx.gbl...
>I have a VS2005/VB Windows application in which I want to rank the contents
>of a "total" field in a dataset but I can't seem to figure out how to do
>this. I've created an SQL DataAdapter and an SQL Dataset and I filled the
>dataset with the values needed. The dataset has "n" rows and the columns
>include "total" (a decimal value) and "rank" (an integer initially set to
>zero). I want to place the ranking value (e.g. 1 through n) for each value
>of "total" in the corresponding "rank" column and then write the updated
>data back to the DB.
> Any suggestions/pointers would be appreciated.
>
Author
23 May 2006 8:38 AM
Wayne Wengert
Cor;

I really do appreciate the response but I have to comment that I get really
tired of worrying about the latest jargon. You say tha a dataset has no
rows - I'm sure that is true in the current jargon but in reality, the
concept of a "row" is there and, in fact, when you want to manipulate the
data you create a "DataRow". How can there be a DataRow if there are no
rows?

The problem I am having is in dealing with the exact syntax required to
perform the ranking across the "rows" of the dataset.

Wayne

Show quoteHide quote
"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
news:ulO7WnifGHA.4864@TK2MSFTNGP05.phx.gbl...
> Wayne,
>
> Start with asking a question as correct as possible so we can understand
> you. A dataset has no rows.
>
> In the datatable you can create an extra column for your problem and than
> use the defaultview to show it in the rank you want.
>
> To show you the column and the expression
> http://www.vb-tips.com/dbPages.aspx?ID=76a81eb8-ea2d-48f4-99c3-a3539697edbd
>
> I hope this helps,
>
> Cor
>
> "Wayne Wengert" <wayneSKIPSPAM@wengert.org> schreef in bericht
> news:uFhx%23gffGHA.1856@TK2MSFTNGP03.phx.gbl...
>>I have a VS2005/VB Windows application in which I want to rank the
>>contents of a "total" field in a dataset but I can't seem to figure out
>>how to do this. I've created an SQL DataAdapter and an SQL Dataset and I
>>filled the dataset with the values needed. The dataset has "n" rows and
>>the columns include "total" (a decimal value) and "rank" (an integer
>>initially set to zero). I want to place the ranking value (e.g. 1 through
>>n) for each value of "total" in the corresponding "rank" column and then
>>write the updated data back to the DB.
>> Any suggestions/pointers would be appreciated.
>>
>
>
Author
23 May 2006 10:30 AM
Cor Ligthert [MVP]
Wayne

In the way you describe it, it means ranking all rows in all datatables
which are in the dataset. Is that what you want, than you should probably
first put all the rows in your own class or any other standard class.

Cor

Show quoteHide quote
"Wayne Wengert" <wayneSKIPSPAM@wengert.org> schreef in bericht
news:%23ZX1KRkfGHA.764@TK2MSFTNGP03.phx.gbl...
> Cor;
>
> I really do appreciate the response but I have to comment that I get
> really tired of worrying about the latest jargon. You say tha a dataset
> has no rows - I'm sure that is true in the current jargon but in reality,
> the concept of a "row" is there and, in fact, when you want to manipulate
> the data you create a "DataRow". How can there be a DataRow if there are
> no rows?
>
> The problem I am having is in dealing with the exact syntax required to
> perform the ranking across the "rows" of the dataset.
>
> Wayne
>
> "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
> news:ulO7WnifGHA.4864@TK2MSFTNGP05.phx.gbl...
>> Wayne,
>>
>> Start with asking a question as correct as possible so we can understand
>> you. A dataset has no rows.
>>
>> In the datatable you can create an extra column for your problem and than
>> use the defaultview to show it in the rank you want.
>>
>> To show you the column and the expression
>> http://www.vb-tips.com/dbPages.aspx?ID=76a81eb8-ea2d-48f4-99c3-a3539697edbd
>>
>> I hope this helps,
>>
>> Cor
>>
>> "Wayne Wengert" <wayneSKIPSPAM@wengert.org> schreef in bericht
>> news:uFhx%23gffGHA.1856@TK2MSFTNGP03.phx.gbl...
>>>I have a VS2005/VB Windows application in which I want to rank the
>>>contents of a "total" field in a dataset but I can't seem to figure out
>>>how to do this. I've created an SQL DataAdapter and an SQL Dataset and I
>>>filled the dataset with the values needed. The dataset has "n" rows and
>>>the columns include "total" (a decimal value) and "rank" (an integer
>>>initially set to zero). I want to place the ranking value (e.g. 1 through
>>>n) for each value of "total" in the corresponding "rank" column and then
>>>write the updated data back to the DB.
>>> Any suggestions/pointers would be appreciated.
>>>
>>
>>
>
>