Editing DataSet

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tony

    #1

    Editing DataSet

    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


  • Jay B. Harlow [MVP - Outlook]

    #2
    Re: Editing DataSet

    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.Colum ns.Add & DataTable.Colum ns.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
    DataGridTableSt yle & DataGridColumnS tyle.

    Hope this helps
    Jay

    "Tony" <liquid__snake@ hotmail.com> wrote in message
    news:e3zW$gxaDH A.2436@TK2MSFTN GP12.phx.gbl...[color=blue]
    > 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[/color]
    column[color=blue]
    > (called Type), and i would like the column Type to be the first column[/color]
    (with[color=blue]
    > an index of zero).
    > How can i do this?
    > Thanks
    > Tony
    >
    >[/color]


    Comment

    • Tony

      #3
      Re: Editing DataSet

      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


      Comment

      • Ignacio Machin

        #4
        Re: Editing DataSet

        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,

        --
        Ignacio Machin,
        ignacio.machin AT dot.state.fl.us
        Florida Department Of Transportation

        "Tony" <liquid__snake@ hotmail.com> wrote in message
        news:%23BvP97xa DHA.2548@TK2MSF TNGP09.phx.gbl. ..[color=blue]
        > What you said i have already tried out before.. but yes.. the problem is[/color]
        the[color=blue]
        > type of the columns are different, one is int32 and one is string which
        > gives me headache coz i can't simply rename it
        >
        >[/color]


        Comment

        Working...