473,386 Members | 1,743 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,386 software developers and data experts.

Sorting Dataviews

I have a dataview setup like this:
DataView.Table = dataset.Tables(0)

DataView.Table.Columns.Add("Sequence", System.Type.GetType("System.Int16"))

Dim count As Integer

For count = 0 To dataset.Tables(0).Rows.Count - 1

DataView.Table.Rows(count)("Sequence") = count

Next
later I do:
DataView.Sort = "Sequence"

& loop though the Rows. If I interfere with loading the sequence column it
dosnt sort.

Later on I might want to swap 2 rows by changing their sequence. Again the
dataview does not sort. The helptext implies no particular restrictions I
can see & I dont see any warnings or errors generated.

In addition I am holding the dataview as a session variable. Will that break
anything ?

Does anyone have any ideas ?

--
Jonathan Bailey.
Nov 20 '05 #1
1 2688
<jb> wrote in message news:41**********************@news.easynet.co.uk.. .
I have a dataview setup like this:
DataView.Table = dataset.Tables(0)

DataView.Table.Columns.Add("Sequence", System.Type.GetType("System.Int16"))
Dim count As Integer

For count = 0 To dataset.Tables(0).Rows.Count - 1

DataView.Table.Rows(count)("Sequence") = count

Next
later I do:
DataView.Sort = "Sequence"

& loop though the Rows. If I interfere with loading the sequence column it
dosnt sort.

Later on I might want to swap 2 rows by changing their sequence. Again the
dataview does not sort. The helptext implies no particular restrictions I
can see & I dont see any warnings or errors generated.

In addition I am holding the dataview as a session variable. Will that break anything ?

Does anyone have any ideas ?

--
Jonathan Bailey.


OK I'm a dork !! I was using DataView.Table.Rows(x) to get the data back not
DataView.Item (x) o DataView(x) since item is the default.
--
Jonathan Bailey.
Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Darryn Ross | last post by:
Hi, I am trying to disable the datagrids ability to sort by it's column headings??? how do i do this? i have set dg.AllowSorting = false but this doesn't make any difference. Thankz Darryn
1
by: Terry McNamee | last post by:
DataView d = new DataView(state.getPlayers()); d.Sort = "Name ASC"; foreach(DataRow dr in d.Table.Rows) { dataMenu.Items.Add(new
2
by: Sriram | last post by:
hi, i have loaded the listbox with the data from a database using dataset. i am finding difficulty in sorting the data. i am not able to find a method to sort data. any help in this regard...
4
by: Mark Travis | last post by:
Hi all, I have written a simple Web Application that displays a query result onto a page using the ASP DataGrid. To Digress ======= Development information about the page is as follows 1....
7
by: Jason | last post by:
Is it possible to somehow sort a dataview, all on one column, but on different variables? That is, I have a 'Title' column in my dataview and I'd like to display first all "Directors" (sorted),...
0
by: Daniel Bass | last post by:
I've already posted this in the asp forum, and other asp.net forums on the net with no luck... I've got a data grid, with paging, and sorting allowed. I can find loads of examples, and have...
3
by: Jerry | last post by:
Hi, I have a couple of datagrids that are based on dataviews. If I filter dataview1 I would like to automatically filter dataview2. I posted something about this before but I think I didn't...
5
by: DKC | last post by:
Hi, Using VB.NET. I have a datagrid having a strongly typed array of objects as its data source. The data from the array of objects is displayed by means of a table style, which is fine, but...
4
by: Bernie Hunt | last post by:
I currently have a datagrid that I'm feeding with a DataSet, which contains three tables. I would like to use a DataView to format the DataTables but I'm not sure how to go about this. Currently...
0
by: anujsharma181 | last post by:
Hi I am trying to sort the child table. Here's the complete scenario. I have used web services to get values in the data set. There are 2 tables T1 and T2 for data sets and they have a parent child...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.