473,382 Members | 1,353 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Rank Dataset Contents

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
3 2156
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Can | last post by:
I am creating an on-line survey. I want the user to have a list of choices of say 10 items that are radio buttons. They need to rank their preference. They click on preference 1, that option is...
2
by: dam_fool_2003 | last post by:
Just now I asked a question about signed char and unsigned char. I had the replay very fast by jens.torring and Tim prince. I post via google so now goes my thanking replay. (I must be more precise...
1
by: PartyFears | last post by:
Dear All, I have the following problem. I have populated a datasset and bound the contents to varous text fields defined in a page. I do this through running Me.Databind in the Form_Load of...
3
by: Mae | last post by:
Dear All, I have a problem here, I'm using C# Webform calling a webservices. The webservices return me a XMLnode, using this XMLnode I want to convert it to dataset so I can bind to the...
2
by: Bennett Haselton | last post by:
I know how to create a DataAdapter that loads data from a data source into a table in a typed DataSet, and how to set the DataSource and DataMember properties of a DataGrid so that at run time it...
5
by: moondaddy | last post by:
I'm caching a dataset in an asp.net session variable to hold a user's data. one data item I need to store is an image the user uploaded. My problem is that I don't know how to get the image into...
13
by: Steve Edwards | last post by:
Hi, Given a map: typedef map<long, string, greater<long> > mapOfFreq; Is there a quicker way to find the rank (i.e. index) of the elememt that has the long value of x? At the moment I'm...
13
by: Maxwell2006 | last post by:
Hi, We are having a debate over using DataSet as return value type for web services. The problem is that we don't know whether Java applications can use DataSet
2
by: orenlevy1 | last post by:
Hi Everyone. I have a problem that I could not figure out what to do with it. I have a couple of tables and views. All have the same unique ID. When a user try to do a search on our web site...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.