XML

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

    #1

    XML

    Hi,

    I have spent the last two days trying to write a class which will act as a
    database table. I will be able to add, delete and update records. Does
    anyone have a sample of this kind of data management?

    Aristotelis


  • Cor Ligthert [MVP]

    #2
    Re: XML

    Pitardidis,

    What you have in mind?

    Do you want to do that on disk, than you cannot do that with an XML, do you
    want that in memory, you can simply use the DataSet. But than read and write
    the complete everytime the Dataset and therefore you can only use this for
    Single User applications.

    I hope this gives an idea,

    Cor

    "Pitaridis Aristotelis" <pitaridis@hotm ail.com> schreef in bericht
    news:1151564031 .37565@athnrd02 ...[color=blue]
    > Hi,
    >
    > I have spent the last two days trying to write a class which will act as a
    > database table. I will be able to add, delete and update records. Does
    > anyone have a sample of this kind of data management?
    >
    > Aristotelis
    >[/color]


    Comment

    • Pitaridis Aristotelis

      #3
      Re: XML

      I want to keep the data in memory. When the application will finish I will
      call the appropriate member function in order to save the data. I know that
      this type of data management will be single user application but it works
      fine for my project.

      My primary problem is that it does not save the last values that I added in
      the DataSet.

      An other problem is that if I delete all the records, the table disappears.

      If I had a proper example of XML table management, I would change it in
      order to work with my problem.

      Aristotelis

      Ï "Cor Ligthert [MVP]" <notmyfirstname @planet.nl> Ýãñáøå óôï ìÞíõìá
      news:ewaH6E1mGH A.2252@TK2MSFTN GP04.phx.gbl...[color=blue]
      >
      > Pitardidis,
      >
      > What you have in mind?
      >
      > Do you want to do that on disk, than you cannot do that with an XML, do
      > you want that in memory, you can simply use the DataSet. But than read and
      > write the complete everytime the Dataset and therefore you can only use
      > this for Single User applications.
      >
      > I hope this gives an idea,
      >
      > Cor
      >
      > "Pitaridis Aristotelis" <pitaridis@hotm ail.com> schreef in bericht
      > news:1151564031 .37565@athnrd02 ...[color=green]
      >> Hi,
      >>
      >> I have spent the last two days trying to write a class which will act as
      >> a database table. I will be able to add, delete and update records. Does
      >> anyone have a sample of this kind of data management?
      >>
      >> Aristotelis
      >>[/color]
      >
      >[/color]


      Comment

      • Patrice

        #4
        Re: XML

        Datasets should keep changes and won't destroy the table if you destroy all
        rows. I would suggest first to post about how to solve these particular
        problems problems before trying to create your own replacement (my first
        guess would be that you don't save the schema but just the data, not sure
        what it could be for the first point)...

        --
        Patrice

        "Pitaridis Aristotelis" <pitaridis@hotm ail.com> a écrit dans le message de
        news: 1151570269.8717 51@athnrd02...[color=blue]
        >I want to keep the data in memory. When the application will finish I will
        >call the appropriate member function in order to save the data. I know that
        >this type of data management will be single user application but it works
        >fine for my project.
        >
        > My primary problem is that it does not save the last values that I added
        > in the DataSet.
        >
        > An other problem is that if I delete all the records, the table
        > disappears.
        >
        > If I had a proper example of XML table management, I would change it in
        > order to work with my problem.
        >
        > Aristotelis
        >
        > Ï "Cor Ligthert [MVP]" <notmyfirstname @planet.nl> Ýãñáøå óôï ìÞíõìá
        > news:ewaH6E1mGH A.2252@TK2MSFTN GP04.phx.gbl...[color=green]
        >>
        >> Pitardidis,
        >>
        >> What you have in mind?
        >>
        >> Do you want to do that on disk, than you cannot do that with an XML, do
        >> you want that in memory, you can simply use the DataSet. But than read
        >> and write the complete everytime the Dataset and therefore you can only
        >> use this for Single User applications.
        >>
        >> I hope this gives an idea,
        >>
        >> Cor
        >>
        >> "Pitaridis Aristotelis" <pitaridis@hotm ail.com> schreef in bericht
        >> news:1151564031 .37565@athnrd02 ...[color=darkred]
        >>> Hi,
        >>>
        >>> I have spent the last two days trying to write a class which will act as
        >>> a database table. I will be able to add, delete and update records. Does
        >>> anyone have a sample of this kind of data management?
        >>>
        >>> Aristotelis
        >>>[/color]
        >>
        >>[/color]
        >
        >[/color]


        Comment

        • Aristotelis Pitaridis

          #5
          Re: XML

          The table will be destroyed when I delete all the data, save the dataset and
          close the application. The next time that I will try to read data from the
          XML file, the table will not be there.

          Ï "Patrice" <scribe@chez.co m> Ýãñáøå óôï ìÞíõìá
          news:Olc3Vu1mGH A.1852@TK2MSFTN GP03.phx.gbl...[color=blue]
          >
          > Datasets should keep changes and won't destroy the table if you destroy
          > all rows. I would suggest first to post about how to solve these
          > particular problems problems before trying to create your own replacement
          > (my first guess would be that you don't save the schema but just the data,
          > not sure what it could be for the first point)...
          >
          > --
          > Patrice
          >
          > "Pitaridis Aristotelis" <pitaridis@hotm ail.com> a écrit dans le message de
          > news: 1151570269.8717 51@athnrd02...[color=green]
          >>I want to keep the data in memory. When the application will finish I will
          >>call the appropriate member function in order to save the data. I know
          >>that this type of data management will be single user application but it
          >>works fine for my project.
          >>
          >> My primary problem is that it does not save the last values that I added
          >> in the DataSet.
          >>
          >> An other problem is that if I delete all the records, the table
          >> disappears.
          >>
          >> If I had a proper example of XML table management, I would change it in
          >> order to work with my problem.
          >>
          >> Aristotelis
          >>
          >> Ï "Cor Ligthert [MVP]" <notmyfirstname @planet.nl> Ýãñáøå óôï ìÞíõìá
          >> news:ewaH6E1mGH A.2252@TK2MSFTN GP04.phx.gbl...[color=darkred]
          >>>
          >>> Pitardidis,
          >>>
          >>> What you have in mind?
          >>>
          >>> Do you want to do that on disk, than you cannot do that with an XML, do
          >>> you want that in memory, you can simply use the DataSet. But than read
          >>> and write the complete everytime the Dataset and therefore you can only
          >>> use this for Single User applications.
          >>>
          >>> I hope this gives an idea,
          >>>
          >>> Cor
          >>>
          >>> "Pitaridis Aristotelis" <pitaridis@hotm ail.com> schreef in bericht
          >>> news:1151564031 .37565@athnrd02 ...
          >>>> Hi,
          >>>>
          >>>> I have spent the last two days trying to write a class which will act
          >>>> as a database table. I will be able to add, delete and update records.
          >>>> Does anyone have a sample of this kind of data management?
          >>>>
          >>>> Aristotelis
          >>>>
          >>>
          >>>[/color]
          >>
          >>[/color]
          >
          >[/color]


          Comment

          • Cor Ligthert [MVP]

            #6
            Re: XML

            Aristotelis,

            That is normal, if you delete the table than it is not anymore after that.
            Therefore can you replie this in other words,

            Cor

            "Aristoteli s Pitaridis" <pitaridis@hotm ail.com> schreef in bericht
            news:1151575327 .145808@athnrd0 2...[color=blue]
            > The table will be destroyed when I delete all the data, save the dataset
            > and close the application. The next time that I will try to read data from
            > the XML file, the table will not be there.
            >
            > Ï "Patrice" <scribe@chez.co m> Ýãñáøå óôï ìÞíõìá
            > news:Olc3Vu1mGH A.1852@TK2MSFTN GP03.phx.gbl...[color=green]
            >>
            >> Datasets should keep changes and won't destroy the table if you destroy
            >> all rows. I would suggest first to post about how to solve these
            >> particular problems problems before trying to create your own replacement
            >> (my first guess would be that you don't save the schema but just the
            >> data, not sure what it could be for the first point)...
            >>
            >> --
            >> Patrice
            >>
            >> "Pitaridis Aristotelis" <pitaridis@hotm ail.com> a écrit dans le message
            >> de news: 1151570269.8717 51@athnrd02...[color=darkred]
            >>>I want to keep the data in memory. When the application will finish I
            >>>will call the appropriate member function in order to save the data. I
            >>>know that this type of data management will be single user application
            >>>but it works fine for my project.
            >>>
            >>> My primary problem is that it does not save the last values that I added
            >>> in the DataSet.
            >>>
            >>> An other problem is that if I delete all the records, the table
            >>> disappears.
            >>>
            >>> If I had a proper example of XML table management, I would change it in
            >>> order to work with my problem.
            >>>
            >>> Aristotelis
            >>>
            >>> Ï "Cor Ligthert [MVP]" <notmyfirstname @planet.nl> Ýãñáøå óôï ìÞíõìá
            >>> news:ewaH6E1mGH A.2252@TK2MSFTN GP04.phx.gbl...
            >>>>
            >>>> Pitardidis,
            >>>>
            >>>> What you have in mind?
            >>>>
            >>>> Do you want to do that on disk, than you cannot do that with an XML, do
            >>>> you want that in memory, you can simply use the DataSet. But than read
            >>>> and write the complete everytime the Dataset and therefore you can only
            >>>> use this for Single User applications.
            >>>>
            >>>> I hope this gives an idea,
            >>>>
            >>>> Cor
            >>>>
            >>>> "Pitaridis Aristotelis" <pitaridis@hotm ail.com> schreef in bericht
            >>>> news:1151564031 .37565@athnrd02 ...
            >>>>> Hi,
            >>>>>
            >>>>> I have spent the last two days trying to write a class which will act
            >>>>> as a database table. I will be able to add, delete and update records.
            >>>>> Does anyone have a sample of this kind of data management?
            >>>>>
            >>>>> Aristotelis
            >>>>>
            >>>>
            >>>>
            >>>
            >>>[/color]
            >>
            >>[/color]
            >
            >[/color]


            Comment

            • Aristotelis Pitaridis

              #7
              Re: XML

              I do not delete the table. I delete the rows. The table disapears
              automatically when there are not records in the table.

              Aristotelis

              Ï "Cor Ligthert [MVP]" <notmyfirstname @planet.nl> Ýãñáøå óôï ìÞíõìá
              news:OndI3g2mGH A.1852@TK2MSFTN GP03.phx.gbl...[color=blue]
              >
              > Aristotelis,
              >
              > That is normal, if you delete the table than it is not anymore after that.
              > Therefore can you replie this in other words,
              >
              > Cor
              >
              > "Aristoteli s Pitaridis" <pitaridis@hotm ail.com> schreef in bericht
              > news:1151575327 .145808@athnrd0 2...[color=green]
              >> The table will be destroyed when I delete all the data, save the dataset
              >> and close the application. The next time that I will try to read data
              >> from the XML file, the table will not be there.
              >>
              >> Ï "Patrice" <scribe@chez.co m> Ýãñáøå óôï ìÞíõìá
              >> news:Olc3Vu1mGH A.1852@TK2MSFTN GP03.phx.gbl...[color=darkred]
              >>>
              >>> Datasets should keep changes and won't destroy the table if you destroy
              >>> all rows. I would suggest first to post about how to solve these
              >>> particular problems problems before trying to create your own
              >>> replacement (my first guess would be that you don't save the schema but
              >>> just the data, not sure what it could be for the first point)...
              >>>
              >>> --
              >>> Patrice
              >>>
              >>> "Pitaridis Aristotelis" <pitaridis@hotm ail.com> a écrit dans le message
              >>> de news: 1151570269.8717 51@athnrd02...
              >>>>I want to keep the data in memory. When the application will finish I
              >>>>will call the appropriate member function in order to save the data. I
              >>>>know that this type of data management will be single user application
              >>>>but it works fine for my project.
              >>>>
              >>>> My primary problem is that it does not save the last values that I
              >>>> added in the DataSet.
              >>>>
              >>>> An other problem is that if I delete all the records, the table
              >>>> disappears.
              >>>>
              >>>> If I had a proper example of XML table management, I would change it in
              >>>> order to work with my problem.
              >>>>
              >>>> Aristotelis
              >>>>
              >>>> Ï "Cor Ligthert [MVP]" <notmyfirstname @planet.nl> Ýãñáøå óôï ìÞíõìá
              >>>> news:ewaH6E1mGH A.2252@TK2MSFTN GP04.phx.gbl...
              >>>>>
              >>>>> Pitardidis,
              >>>>>
              >>>>> What you have in mind?
              >>>>>
              >>>>> Do you want to do that on disk, than you cannot do that with an XML,
              >>>>> do you want that in memory, you can simply use the DataSet. But than
              >>>>> read and write the complete everytime the Dataset and therefore you
              >>>>> can only use this for Single User applications.
              >>>>>
              >>>>> I hope this gives an idea,
              >>>>>
              >>>>> Cor
              >>>>>
              >>>>> "Pitaridis Aristotelis" <pitaridis@hotm ail.com> schreef in bericht
              >>>>> news:1151564031 .37565@athnrd02 ...
              >>>>>> Hi,
              >>>>>>
              >>>>>> I have spent the last two days trying to write a class which will act
              >>>>>> as a database table. I will be able to add, delete and update
              >>>>>> records. Does anyone have a sample of this kind of data management?
              >>>>>>
              >>>>>> Aristotelis
              >>>>>>
              >>>>>
              >>>>>
              >>>>
              >>>>
              >>>
              >>>[/color]
              >>
              >>[/color]
              >
              >[/color]


              Comment

              • Patrice

                #8
                Re: XML

                As I previously said I believe that this is because you save only the data,
                not the table schema. Use the second parameter of the WriteXml method to
                explicitely tells to save the schema.

                (see
                http://msdn.microsoft.com/library/de...exmltopic6.asp
                for details).

                Hope this helps.

                --
                Patrice

                "Aristoteli s Pitaridis" <pitaridis@hotm ail.com> a écrit dans le message de
                news: 1151578335.8826 25@athnrd02...[color=blue]
                >I do not delete the table. I delete the rows. The table disapears
                >automaticall y when there are not records in the table.
                >
                > Aristotelis
                >
                > Ï "Cor Ligthert [MVP]" <notmyfirstname @planet.nl> Ýãñáøå óôï ìÞíõìá
                > news:OndI3g2mGH A.1852@TK2MSFTN GP03.phx.gbl...[color=green]
                >>
                >> Aristotelis,
                >>
                >> That is normal, if you delete the table than it is not anymore after
                >> that. Therefore can you replie this in other words,
                >>
                >> Cor
                >>
                >> "Aristoteli s Pitaridis" <pitaridis@hotm ail.com> schreef in bericht
                >> news:1151575327 .145808@athnrd0 2...[color=darkred]
                >>> The table will be destroyed when I delete all the data, save the dataset
                >>> and close the application. The next time that I will try to read data
                >>> from the XML file, the table will not be there.
                >>>
                >>> Ï "Patrice" <scribe@chez.co m> Ýãñáøå óôï ìÞíõìá
                >>> news:Olc3Vu1mGH A.1852@TK2MSFTN GP03.phx.gbl...
                >>>>
                >>>> Datasets should keep changes and won't destroy the table if you destroy
                >>>> all rows. I would suggest first to post about how to solve these
                >>>> particular problems problems before trying to create your own
                >>>> replacement (my first guess would be that you don't save the schema but
                >>>> just the data, not sure what it could be for the first point)...
                >>>>
                >>>> --
                >>>> Patrice
                >>>>
                >>>> "Pitaridis Aristotelis" <pitaridis@hotm ail.com> a écrit dans le message
                >>>> de news: 1151570269.8717 51@athnrd02...
                >>>>>I want to keep the data in memory. When the application will finish I
                >>>>>will call the appropriate member function in order to save the data. I
                >>>>>know that this type of data management will be single user application
                >>>>>but it works fine for my project.
                >>>>>
                >>>>> My primary problem is that it does not save the last values that I
                >>>>> added in the DataSet.
                >>>>>
                >>>>> An other problem is that if I delete all the records, the table
                >>>>> disappears.
                >>>>>
                >>>>> If I had a proper example of XML table management, I would change it
                >>>>> in order to work with my problem.
                >>>>>
                >>>>> Aristotelis
                >>>>>
                >>>>> Ï "Cor Ligthert [MVP]" <notmyfirstname @planet.nl> Ýãñáøå óôï ìÞíõìá
                >>>>> news:ewaH6E1mGH A.2252@TK2MSFTN GP04.phx.gbl...
                >>>>>>
                >>>>>> Pitardidis,
                >>>>>>
                >>>>>> What you have in mind?
                >>>>>>
                >>>>>> Do you want to do that on disk, than you cannot do that with an XML,
                >>>>>> do you want that in memory, you can simply use the DataSet. But than
                >>>>>> read and write the complete everytime the Dataset and therefore you
                >>>>>> can only use this for Single User applications.
                >>>>>>
                >>>>>> I hope this gives an idea,
                >>>>>>
                >>>>>> Cor
                >>>>>>
                >>>>>> "Pitaridis Aristotelis" <pitaridis@hotm ail.com> schreef in bericht
                >>>>>> news:1151564031 .37565@athnrd02 ...
                >>>>>>> Hi,
                >>>>>>>
                >>>>>>> I have spent the last two days trying to write a class which will
                >>>>>>> act as a database table. I will be able to add, delete and update
                >>>>>>> records. Does anyone have a sample of this kind of data management?
                >>>>>>>
                >>>>>>> Aristotelis
                >>>>>>>
                >>>>>>
                >>>>>>
                >>>>>
                >>>>>
                >>>>
                >>>>
                >>>
                >>>[/color]
                >>
                >>[/color]
                >
                >[/color]


                Comment

                • Cor Ligthert [MVP]

                  #9
                  Re: XML

                  Can you show us some code that you use to write the dataset. As Patrice
                  wrote already you probably don't write the scheme

                  Cor

                  "Aristoteli s Pitaridis" <pitaridis@hotm ail.com> schreef in bericht
                  news:1151578335 .882625@athnrd0 2...[color=blue]
                  >I do not delete the table. I delete the rows. The table disapears
                  >automaticall y when there are not records in the table.
                  >
                  > Aristotelis
                  >
                  > Ï "Cor Ligthert [MVP]" <notmyfirstname @planet.nl> Ýãñáøå óôï ìÞíõìá
                  > news:OndI3g2mGH A.1852@TK2MSFTN GP03.phx.gbl...[color=green]
                  >>
                  >> Aristotelis,
                  >>
                  >> That is normal, if you delete the table than it is not anymore after
                  >> that. Therefore can you replie this in other words,
                  >>
                  >> Cor
                  >>
                  >> "Aristoteli s Pitaridis" <pitaridis@hotm ail.com> schreef in bericht
                  >> news:1151575327 .145808@athnrd0 2...[color=darkred]
                  >>> The table will be destroyed when I delete all the data, save the dataset
                  >>> and close the application. The next time that I will try to read data
                  >>> from the XML file, the table will not be there.
                  >>>
                  >>> Ï "Patrice" <scribe@chez.co m> Ýãñáøå óôï ìÞíõìá
                  >>> news:Olc3Vu1mGH A.1852@TK2MSFTN GP03.phx.gbl...
                  >>>>
                  >>>> Datasets should keep changes and won't destroy the table if you destroy
                  >>>> all rows. I would suggest first to post about how to solve these
                  >>>> particular problems problems before trying to create your own
                  >>>> replacement (my first guess would be that you don't save the schema but
                  >>>> just the data, not sure what it could be for the first point)...
                  >>>>
                  >>>> --
                  >>>> Patrice
                  >>>>
                  >>>> "Pitaridis Aristotelis" <pitaridis@hotm ail.com> a écrit dans le message
                  >>>> de news: 1151570269.8717 51@athnrd02...
                  >>>>>I want to keep the data in memory. When the application will finish I
                  >>>>>will call the appropriate member function in order to save the data. I
                  >>>>>know that this type of data management will be single user application
                  >>>>>but it works fine for my project.
                  >>>>>
                  >>>>> My primary problem is that it does not save the last values that I
                  >>>>> added in the DataSet.
                  >>>>>
                  >>>>> An other problem is that if I delete all the records, the table
                  >>>>> disappears.
                  >>>>>
                  >>>>> If I had a proper example of XML table management, I would change it
                  >>>>> in order to work with my problem.
                  >>>>>
                  >>>>> Aristotelis
                  >>>>>
                  >>>>> Ï "Cor Ligthert [MVP]" <notmyfirstname @planet.nl> Ýãñáøå óôï ìÞíõìá
                  >>>>> news:ewaH6E1mGH A.2252@TK2MSFTN GP04.phx.gbl...
                  >>>>>>
                  >>>>>> Pitardidis,
                  >>>>>>
                  >>>>>> What you have in mind?
                  >>>>>>
                  >>>>>> Do you want to do that on disk, than you cannot do that with an XML,
                  >>>>>> do you want that in memory, you can simply use the DataSet. But than
                  >>>>>> read and write the complete everytime the Dataset and therefore you
                  >>>>>> can only use this for Single User applications.
                  >>>>>>
                  >>>>>> I hope this gives an idea,
                  >>>>>>
                  >>>>>> Cor
                  >>>>>>
                  >>>>>> "Pitaridis Aristotelis" <pitaridis@hotm ail.com> schreef in bericht
                  >>>>>> news:1151564031 .37565@athnrd02 ...
                  >>>>>>> Hi,
                  >>>>>>>
                  >>>>>>> I have spent the last two days trying to write a class which will
                  >>>>>>> act as a database table. I will be able to add, delete and update
                  >>>>>>> records. Does anyone have a sample of this kind of data management?
                  >>>>>>>
                  >>>>>>> Aristotelis
                  >>>>>>>
                  >>>>>>
                  >>>>>>
                  >>>>>
                  >>>>>
                  >>>>
                  >>>>
                  >>>
                  >>>[/color]
                  >>
                  >>[/color]
                  >
                  >[/color]


                  Comment

                  Working...