datatable.HasChanges() ?

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

    #1

    datatable.HasChanges() ?

    Gday,

    Have been going through the walkthrough for a distributed application:
    http://msdn2.microsoft.com/en-us/library/1as0t7ff.aspx

    and it appears to suggest in the SaveData_Click method that you can check a
    datatable for changes, ie

    if (CustomerData.H asChanges())

    However when I try to build this I get the error:

    Error 1 '<blah>DataTabl e' does not contain a definition for 'HasChanges'

    Am I doing something stupid or do datatables not have this method available?

    Thanks,

    Peter



  • Jon Skeet [C# MVP]

    #2
    Re: datatable.HasCh anges() ?

    mrstrong <mrstrong@hotma il.com> wrote:[color=blue]
    > Have been going through the walkthrough for a distributed application:
    > http://msdn2.microsoft.com/en-us/library/1as0t7ff.aspx
    >
    > and it appears to suggest in the SaveData_Click method that you can check a
    > datatable for changes, ie
    >
    > if (CustomerData.H asChanges())
    >
    > However when I try to build this I get the error:
    >
    > Error 1 '<blah>DataTabl e' does not contain a definition for 'HasChanges'
    >
    > Am I doing something stupid or do datatables not have this method available?[/color]

    There is no DataTable.HasCh anges() method - there is only
    DataSet.HasChan ges().

    --
    Jon Skeet - <skeet@pobox.co m>
    http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
    If replying to the group, please do not mail me too

    Comment

    • mrstrong

      #3
      Re: datatable.HasCh anges() ?

      "Jon Skeet [C# MVP]" <skeet@pobox.co m> wrote in message
      news:MPG.1e133c fa3ef7f3a998cb6 f@msnews.micros oft.com...[color=blue]
      > mrstrong <mrstrong@hotma il.com> wrote:[color=green]
      >>
      >> and it appears to suggest in the SaveData_Click method that you can check
      >> a
      >> datatable for changes, ie
      >>
      >> if (CustomerData.H asChanges())
      >>
      >> However when I try to build this I get the error:
      >>
      >> Error 1 '<blah>DataTabl e' does not contain a definition for 'HasChanges'
      >>
      >> Am I doing something stupid or do datatables not have this method
      >> available?[/color]
      >
      > There is no DataTable.HasCh anges() method - there is only
      > DataSet.HasChan ges().
      >[/color]

      Thanks. So the 'save' method on the walkthrough was not right?

      http://msdn2.microsoft.com/en-us/library/1as0t7ff.aspx

      Regards,

      Peter



      Comment

      • Jon Skeet [C# MVP]

        #4
        Re: datatable.HasCh anges() ?

        mrstrong <mrstrong@hotma il.com> wrote:[color=blue][color=green]
        > > There is no DataTable.HasCh anges() method - there is only
        > > DataSet.HasChan ges().[/color]
        >
        > Thanks. So the 'save' method on the walkthrough was not right?
        >
        > http://msdn2.microsoft.com/en-us/library/1as0t7ff.aspx[/color]

        Looks like it, yes.

        --
        Jon Skeet - <skeet@pobox.co m>
        http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
        If replying to the group, please do not mail me too

        Comment

        • theiwaz

          #5
          Re: datatable.HasCh anges() ?

          Correct the DataTable class just defines DataTable.GetCh anges() Method.

          Comment

          • mrstrong

            #6
            Re: datatable.HasCh anges() ?

            "theiwaz" <marcus.peters@ ascirum.de> wrote in message
            news:1135167049 .027275.306350@ g49g2000cwa.goo glegroups.com.. .[color=blue]
            > Correct the DataTable class just defines DataTable.GetCh anges() Method.
            >[/color]

            Hmmm.. Not in front of my work machine at present so cant try this out, but
            can a datatable be NULL?

            So could the following be used to test for changes to a datatable:

            if (DataTable.GetC hanges() != NULL)

            ?

            (not sure about the exact syntax)

            Peter




            Comment

            Working...