Accessing data without using database (.Net 2005).

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • priyamtheone
    New Member
    • Sep 2007
    • 88

    #1

    Accessing data without using database (.Net 2005).

    Is it possible to add, edit, view and delete records using a file only (instead of
    a database) and .Net 2005 (VB.Net/C#)?
    The concept is that a file that'll work more-or-less like a database. One can add, edit, view, delete and query data to and from the file. The file, either cannot be opened directly or data inside the file should be in some encrypted form so that even if the file is opened no one can comprehend it. Data inside the file can only be manipulated by a front end application i.e. .Net 2005.

    If there's some methodology like this then please refer me some links to tutorials
    and whitepapers. Thanks in advance.
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    I suppose one could use a simple text file, but encrypt the lines of data in it.

    But to add, edit, view, delete, and query... That's another story.
    One would have to have single-use access to the text file.
    Adding is a simple file.append
    Deleting would mean read it all into memory, remove the one entry, then write it all back out.
    Query would mean reading it all in then search for what you want.
    Edit would be much like deleting, read it all in, make a change, write it all back out.

    Some of that could be avoided if every record were a fixed length. Then you could seek to a given point and write a change. But that deleting still means re-writing the entire file.

    So the short answer is 'yes', it could be done. But the reality is that it would quickly become unreasonable if you had more than a simple list of delimited fields. And it is totally impractical if you need more than one person to have simultaneous access.

    There are many articles on encryption. Just google for "MSDN Encryption"


    http://msdn.microsoft.com/en-us/maga...55.aspx?ppud=4

    Comment

    • Curtis Rutland
      Recognized Expert Specialist
      • Apr 2008
      • 3264

      #3
      I would suggest using XML and encryption. Using LINQ to XML you can handle updating, inserting, and deleting very easily.

      But I think your best bet would be to use a compact, portable DB. Something like sqlite.

      Comment

      • priyamtheone
        New Member
        • Sep 2007
        • 88

        #4
        Yeah XML is one of the best options. Most peers suggested this way. Sqlite is also another good option. There are certain scenarios where DBMS like MSSQL or Oracle is too expensive and needs large setup. Portable DB like Sqlite serves the purpose well indeed. Thanks anyway.

        Comment

        Working...