| | |
Help sorting a cloned dataset
Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Feb 2009
Posts: 38
Reputation:
Solved Threads: 0
I am trying to make an application that sorts a database with user input and returns a form. This form then accepts some user input, and then needs to be sorted in another event. I am using ado.net, and am attempting to complete this task by cloning a dataset and using select commands on the cloned dataset. This is the basic outline of how I'm trying to do this currently
this part works fine.
This part returns a blank table in the same schema as the above table.
So in conclusion, I need to query a dataset from my database, and then I need to use the sort/compute commands on this data from another event.
C# Syntax (Toggle Plain Text)
public DataSet ds; 1 st button click event { initialize variable, set to input values... oledbcommand cmd = new oledbcommand("SELECT * FROM TBL, database"); da.selectcommand = cmd; oledbcommandbuilder cb = new oledbcommandbuilder(da); ds = new dataset(); da.fill(ds); datagridview.datasource = ds.tables[0]; }
this part works fine.
C# Syntax (Toggle Plain Text)
2nd button click event { dataset form = new dataset(); form = ds.Clone(); datatable dt = form.tables[0]; dt.select("FieldName > 0"); datagridview.datasource = dt; }
This part returns a blank table in the same schema as the above table.
So in conclusion, I need to query a dataset from my database, and then I need to use the sort/compute commands on this data from another event.
![]() |
Other Threads in the C# Forum
- Previous Thread: Combobox in GridView
- Next Thread: c# Network Stream
| Thread Tools | Search this Thread |
.net access algorithm angle array barchart bitmap box broadcast c# capturing check checkbox client combobox control conversion convert csharp custom database datagrid datagridview dataset datetime dbconnection degrees delegate design development disappear draganddrop drawing encryption enum event excel file firefox form format forms function gdi+ httpwebrequest image index input install java label leak libraries list listbox mandelbrot math monodevelop mouseclick msword mysql operator path pause photoshop picturebox pixelinversion post programming radians regex remote remoting richtextbox round server sleep socket sql statistics stream string table tcpclientchannel text textbox thread time timer update usercontrol validation virtualization visualbasic visualstudio webbrowser windows winforms wpf xml





