By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,836 Members | 1,983 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,836 IT Pros & Developers. It's quick & easy.

Rank Dataset Contents

P: n/a
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.
May 22 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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?...3-a3539697edbd

I hope this helps,

Cor

"Wayne Wengert" <wa***********@wengert.org> schreef in bericht
news:uF****************@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.

May 23 '06 #2

P: n/a
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]" <no************@planet.nl> wrote in message
news:ul**************@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?...3-a3539697edbd

I hope this helps,

Cor

"Wayne Wengert" <wa***********@wengert.org> schreef in bericht
news:uF****************@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.


May 23 '06 #3

P: n/a
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

"Wayne Wengert" <wa***********@wengert.org> schreef in bericht
news:%2***************@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]" <no************@planet.nl> wrote in message
news:ul**************@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?...3-a3539697edbd

I hope this helps,

Cor

"Wayne Wengert" <wa***********@wengert.org> schreef in bericht
news:uF****************@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.



May 23 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.