Skip to content

Asp.net mvc

Suresh Cherukupally

Asked Mar 18, 2015, 3:10 AM EDT1 answer
Share
LinkedInX
can anybody give me the proceedure for inserting videos into database and how to reteive and display web page in  ASP.net mvc application?

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • Afzaal Ahmad Zeeshan
    0
    Before I give you an idea about doing the same, I would give you a life saving tip: Do not save your binary files in the database, they consume your expensive database space. Instead store your binary files (or just files) into your file system and store their names into the database table. It is more preferable way of implementing the same procedure. 


    Finally, if you still want to do the same... You are going to first change the schema of your database's table. Create a table, and set its type to image (which would hold binary data); note that it doesn't represent the image files but all kind of files. 


    You can insert the binary of the file into this column, and retrieve the binary data from this column; convert it to file using WriteBytes and add a MIME-type to denote what type of file it is. Once returned, use that file in the HTML element on your web page. 


    Read this example article by Mikesdotnetting, to learn more on this process (about images). http://www.mikesdotnetting.com/article/148/save-and-retrieve-files-from-a-sql-server-ce-database-with-webmatrix
    0