c# - Saving each user's file along with corresponding database / table -


context: writing application in visual c# / .net, user can:

  • create new document-file "untitled.abc"
  • add data/content, e.g., images, text, etc.
  • save document-file "mydoc7.abc", abc app-specific extension.

question: following method implement above, or there simpler/cleaner approach?

  • i start sql-server database called mydb.
  • each time user creates new document-file, programatically add new db table mydb
  • the newly created db table stores data/content particular corresponding document-file created user.
  • when user re-opens saved document-file in future, programatically read data/content attached corresponding db table.

update: solved. using alternative approach:

  • i start sql-server database called mydb table called mytable, including column called fileid.
  • each time user creates new document-file, assign file unique id, e.g., fileid = 5.
  • when user adds piece of data/content file, store piece of data mytable, store fileid = 5 piece of data.
  • in future, when user re-opens file, fetch pieces of data mytable fileid = 5.

that sounds particularly bad idea that.

  1. you don't want create tables on fly
  2. if data in database, file for?

i rather choose approach office uses:

  1. the file zip archive contains:
    1. a folder assets (images , like)
    2. the actual file content , relative links assets.

Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -