Saving a Database to Disk

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

    #1

    Saving a Database to Disk

    Ok, I've got a program I am working on that is supposed to save all
    changes to the dataset to the actual database, but this doesn't seem to
    be working. I used the DataAdapter.Upd ate(DataSet) method, but that
    doesn't save the changes to my actual database.

    How can I go about updating the actual database to save changes?
    Please help,
    Jager

  • Cor Ligthert [MVP]

    #2
    Re: Saving a Database to Disk

    Jager,

    A dataadapter update does only save datarows from which the rowstate is not
    "not changed".

    However how a rowstate is set, depends very much how your program is build,
    so therefore you have to tell more.

    Cor


    Comment

    • Jager

      #3
      Re: Saving a Database to Disk

      Well I can use the commands to add information to my database and it
      saves the changes to the database itself, but when I delete rows by
      using RemoveAt for the CurrentSelected Row , the database won't save the
      changes. I have also tried the delete method and I don't beleve that
      worked. What I need it to do is save the changes to the database in
      anyway possible without manually saving the changes ( I can't expect
      the person using this to save on his own.) If I can get this all to
      work, I'll be in good shape, I think.

      Comment

      • Kerry Moorman

        #4
        Re: Saving a Database to Disk

        Jager,

        You need to use Delete if you are trying to mark the row for deletion from
        the database.

        Kerry Moorman


        "Jager" wrote:
        [color=blue]
        > Well I can use the commands to add information to my database and it
        > saves the changes to the database itself, but when I delete rows by
        > using RemoveAt for the CurrentSelected Row , the database won't save the
        > changes. I have also tried the delete method and I don't beleve that
        > worked. What I need it to do is save the changes to the database in
        > anyway possible without manually saving the changes ( I can't expect
        > the person using this to save on his own.) If I can get this all to
        > work, I'll be in good shape, I think.
        >
        >[/color]

        Comment

        • Cor Ligthert [MVP]

          #5
          Re: Saving a Database to Disk

          Jager,

          In addition to Kerry,

          RemoveAt or all other Removes in this situations, remove a datarow complete
          from a datatable with all its aspects.

          A delete, set the row to be removed after and update or with an
          acceptchanges.

          (This alone for those row for which this is important. newly added rows will
          be with delete as well direct removed from a datatable)

          I hope this helps,

          Cor


          Comment

          Working...