Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting order of an existing dataset

Status
Not open for further replies.

markftwain

Technical User
Jul 12, 2006
108
Hi experts,

I am very slowly moving from vfp to C#. After much reading I am unable to find a simple answer to this question:

Having created a dataset using the visual foxpro ole db, can the dataset row order be changed based on the value in a specific column without creating a new dataset from it?

My simplistic thinking is to create one dataset from the vfp tables in the order it will be displayed by a XAML DataGrid without using a sort on the CollectionViewSource. The wizards allready provide the marshalling from vfp to .net and automate the creation of the first dataset. I would like to use this dataset directly without creating a new dataset from it just to set the view order.

system setup:
Visual foxpro 9
Windows 7
visual studio 2010
.net framework 4

Thank you for your time and patience.
 
you don't order datasets, you order tables with in datasets. datasets/tables are just that data. you can sort/filter the results using a DataView against a datatable. from this view you can bind to the UI, or you can convert the DataView to a new DataTable and bind to that as well.

what you don't do is rearrange the rows of the existing datatables/set.

Jason Meckley
Programmer

faq855-7190
faq732-7259
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top