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 569157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:15:54+00:00 2026-05-13T13:15:54+00:00

I have a DataView object with productID and productName, i get all items from

  • 0

I have a DataView object with productID and productName,
i get all items from Products Table and store them in Cache.
I want to get items that user bought in order he bought them without using another query or joining tables.

ie.
Products DataView
1. Foo
2. Foo2
3. Foo3

Filtering to ProductsBoughtByUser using RowFilter (productID in (1,3))
UserProducts DataView
1.Foo
3.Foo3

Now user first bought Foo3, how do i reorder items based on correct ( chronological ) Array. ie 3 1

Thanks

  • 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-13T13:15:55+00:00Added an answer on May 13, 2026 at 1:15 pm

    Here is the syntax for DataView.Sort:

    private void SortByTwoColumns()
    {
        // Get the DefaultViewManager of a DataTable.
        DataView view = DataTable1.DefaultView;
    
        // By default, the first column sorted ascending.
        view.Sort = "State, ZipCode DESC";
    }
    

    From your original post, it sounds like you only have Product ID and Product Name. You can’t sort these in memory unless you’re also retrieving a purchase/order date.

    Probably the easiest thing to do would be to add the date column (PurchaseDate) to your sql statement that you’re already using, then do a view.Sort = "PurchaseDate DESC";

    That way, you don’t have to write another statement or hit the database a second time for this sort.

    Edit:
    The DataRowView has integral and string indexers. e.g.:

    foreach (DataRowView row in dataView)
    { 
       var value = row["COLUMN_NAME"]; 
    }
    

    The column is stored as an object, so you’ll have to check for null and convert to your data type

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

Sidebar

Related Questions

I have a table (Dataview) with content from a database, where each row/object has
I have a System.Data.DataView object but only want the first ten records, sorted by
I'm using Sencha touch 2. I have store that load from existing js object:
How to filter DataView/DataTable by time? I have a table with datetime column inside
i have two lists named Categories and Products.I paged Categories List in a dataview(1
I have a session object that contains a DataTable from my previous page, and
I have a problem i have some dynamic button.and i want to store integer
The DataView object doesn't have a Rows property like DataTable . How do I
I have a function (on vb.net) to get a data from a XMLWebService: Private
I have a table with say 1640 items. I set bindingSource.Filter = some filter

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.