Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5942909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:19:11+00:00 2026-05-22T16:19:11+00:00

What I want to do is basically have a column that ranks the users

  • 0

What I want to do is basically have a column that ranks the users so if there were 10 people it would rank the person with the highest sales 10 and the second highest 9 and so on. Theres not always going to be 10 employees

I am using a stored procedure along with a sqldatasource to connect to my stored procedure.
To get all the data for each agent, then I am using functions like

 Dim TotalSales As Decimal = 0.0
    Function GetTotalSales(ByVal Price As Decimal) As Decimal
        TotalSales += Price
        Return Price
    End Function
    Function GetTotal() As Decimal
        Return TotalSales
    End Function


    Dim TotalCalls As Decimal = 0.0
    Function GetCalls(ByVal calls As Decimal) As Decimal
        TotalCalls += calls
        Return calls
    End Function
    Function GetTotalCalls() As Decimal
        Return TotalCalls
    End Function

to get running totals

could i do something like

Dim salesrank As Decimal = 0.0
    Function Getsalesrank(ByVal salestorank As Decimal) As Decimal
        Dim rank As New ArrayList
        rank.Add(salestorank)



    End Function

and then some how sort the array list and print the index of the agents sales total?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T16:19:12+00:00Added an answer on May 22, 2026 at 4:19 pm

    Since you’re using .Net 2.0 and apparently not adverse to using the built-in classes to accomplish data calls, I would recommend you switch from using the SQLDataSource to a strongly typed DataSet (.xsd file). You can create a typed DataTable and TableAdapter that will perform your initial queries and produce collection objects (tables) that can hold the data you need while you do other things to it. Once you have your dataset created you can call it simply by:

    Dim connectionObject as System.Data.SqlClient.SqlConnection = _
        New System.Data.SqlClient.SqlConnection("Put your string here")
    
    Dim myAdapter as MyStronglyTypedTableAdapter
    Dim myTable as MyStronglyTypedTable
    
    myAdapter.Connection = connectionObject
    myTable = myAdapter.GetData()
    

    If you create your DataTable so that it holds an empty column called TotalSales (I’m assuming the data table is holding data indexed by users), you can populate that column using your total sales method. Once you have the table organized by user you can use the table’s DefaultView to sort and bind to your GridView:

    Dim myView as DataView = myTable.DefaultView
    myView.Sort = "TotalSales ASC"
    myGridView.DataSource = myView
    myGridView.DataBind()
    

    When this is done you can manipulate one of the columns of your GridView to display the numeric ranking. This would be done in the RowDataBound event.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, I have a table for users and a column that stores an integer.
Basically I have some variables that I don't want to preinitialize: originalTime = None
Basically I have a single page on my site that I want any php
I have a partial view that I want to basically take care of itself
So basically I have a main table, and I want to filter that data
I want have a query with a column that is a hardcoded value not
Basically i have a function that returns a column vector of size Z(100,1) of
So I basically want to have a static method in my AR class to
i'm experimenting with django and the builtin admin interface. I basically want to have
I have a 2-dimensional array of objects and I basically want to databind each

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.