c# - Storing html content and other documents (pdf, word, excel) in sql server? -


What is the best datatype for storing HTML content and documents like PDF, axle files, and word documents. I am currently using ntext, but I'm not sure that this is the best datatype for storing html content.

In addition, I currently use the FCADEditor to save the HTML contents in an Entext field and it stores the markup together. If I share the details in the ItemTemplate of a ListView To read with:

  <% Eval ("content")%>  

This content displays, but it also shows markup, for example, instead of displaying:

"This is an html string" , this & lt; P & gt; This is and HTML & lt; B & gt; String & lt;

I have HTML NVHAR (max) (or if you do not need more than 4000 characters) Do not use text / ntn data type unless you are stuck in SQL Server 2000. They have been boycotted and their use of the maximum benefits has been made to the idiot IMHO.

I'll check files to FILESTREAM in SQL Server 2008. If you & lt; 2008, or if you have checked the trade-off and FILESTREAM is not an option, then my personal preference is to store files on the file system, and there is a local and / or HT reference for the file in the database.

The advantage of storing files in a database is that you get transitional stability. The downside is that you use more database space, which is usually more expensive on storage, you have a Very difficult time is debugging (you can not just say "PDFFile SELECT from the table" in the management studio, and hope to pop up the Acrobat Reader and show the contents of your column).

Since being employed, I have to trust and sign more rights for more sexual rights to children with me, and use my database space in comparison to the use of my file location on play. For more lot is charged, I have backed up filesystem files every time our file system is backed up, and when it does not sync with the database backup 100% very The less file has seen issues of corruption which was not an end user's fault (and easily improved without our involvement) - zero, in fact - it does not seem worth it to investigate.

Like I said, personal preference but ask the right questions and understand your goals and boundaries.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -