views:

28

answers:

1

I have an ASP.NET MVC application and I want to embed on each page some help content. This will be HTML pages that will be loaded into a dialog or new browser page (to be decided). Obviously I could store this in a max text field in the DB, but I also think I could store it in a FileStream. This sounds appealing to me as it would allow my devs to edit the HTML without requiring a special tool that can access the DB content.

Assuming this HTML is not going to be massive, is this a sensible use of a Filestream or should I simply use a regular text column?

+1  A: 

This is not how Filestream works - you cannot modify the files without going through the database. That would be equivalent to editing .mdf files - effectively corrupting the database.

Also keep in mind that unless your HTML files are at least 500 KiB in size (unlikely for HTML files), you may achieve better performance storing them inside the database (e.g. in nvarchar(max) columns).

Pawel Marciniak

related questions