Editing DataSet

  • Thread starter Thread starter Tony
  • Start date Start date
T

Tony

Hello,
I want to edit a dataset returned from a webservice, in the dataset, there
is three columns - DisplayOrder, Location, Time...
What i would like to do is replace the DisplayOrder column with a new column
(called Type), and i would like the column Type to be the first column (with
an index of zero).
How can i do this?
Thanks
Tony
 
Tony,
When you say 'edit' are you referring to Windows Forms or Web Forms?

Have you tried adding a column to the DataTable object & removing the
unwanted column (after you received it). Then bind the DataTable to a
System.Windows.Forms.DataGrid?

See DataTable.Columns.Add & DataTable.Columns.Remove

When you bind to the System.Windows.Forms.DataGrid you can give Table Styles
to specify the order of the columns displayed (or hidden). See
DataGridTableStyle & DataGridColumnStyle.

Hope this helps
Jay
 
What you said i have already tried out before.. but yes.. the problem is the
type of the columns are different, one is int32 and one is string which
gives me headache coz i can't simply rename it
 
Hi Tony,

May I ask why you want to insert the new column in the first position?
that's the origin of all yours trouble, if you can live with it inserted at
the end, then you are ok.

Cheers,
 
Back
Top