How to save data in unbound datagridview in vb.net

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jehan
    New Member
    • Oct 2014
    • 3

    How to save data in unbound datagridview in vb.net

    Dear all,

    I have three textbox's and their data is added in the DGV. I dont know how to save the data so that next time when I open the DVG the previous data is stored.

    Please note I want all the data to be stored in the application its self.

    Thanks.
    Plz help
  • twinnyfo
    Recognized Expert Moderator Specialist
    • Nov 2011
    • 3662

    #2
    The easiest way would be to create a small text file to save the information, but I know that is not your intent. As you know, many applications use additional files to store configuration settings.

    Comment

    • Frinavale
      Recognized Expert Expert
      • Oct 2006
      • 9749

      #3
      Data loaded in memory is only available while the application is running. Once the application is closed, all of the data loaded will be unloaded and destroyed.

      If you need to the data to be available after the application has closed you need to store it somewhere so that it can be re-loaded into memory the next time the application is started.

      You could use a database to store the data. There are free ones available that you can use (like mySQL).

      Or, if your application is relatively simple, you could write data into a file so that it can simply read the file the next time the application is opened to recreate the data you need.

      If you are going to save data into a file, I recommend storing it in XML format because it works well with Object Oriented Programming.

      Here is a link to the MSDN Documentation for the XmlSerilizer Class that is used to serialize objects into XML. Hers is another MSDN article on the topic of XML Serialization in the .NET Framework.

      -Frinny
      Last edited by Frinavale; Oct 27 '14, 02:29 PM.

      Comment

      • iam_clint
        Recognized Expert Top Contributor
        • Jul 2006
        • 1207

        #4
        to add on to what Frinavale has said you can also use http://www.sqlite.org/ which is free, I have used it in several applications and it works quite well.

        SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. SQLite is the most widely deployed SQL database engine in the world. The source code for SQLite is in the public domain.

        Comment

        Working...