Click here to Skip to main content
15,905,612 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am creating a form in which I have put

QID
Question
Choice 1
Choice 2
Choice 3
Choice 4
Choice 5
CorrectAns

These things I want to store in Sql Server. the question can be Text, Image, Video.

When I search question by QID every thing relating to the QID should be shown in respective field.

How to do?

What I have tried:

In a simple way inserting updating deleting querying is possible in vb.net with sql server when question field is text. but how to do with image and video also
Posted
Updated 16-Nov-18 20:14pm

1 solution

You can do it, by storing it all in a binary format, in what is called a LOB: What is the difference between LOB and binary data in SQL Server? - Database Administrators Stack Exchange[^] - basically, use VARBINARY(MAX) and you should be fine.

But ... it's a bad idea. Video in particular becomes very large,m very quickly, and storing it in SQL means it will use huge amounts of SQL bandwidth to store and access - two or more users doing this at the same time can cause SQL to start to grind to a halt!

Instead, store it in a file, and store the path to that file (plus the original file name) in SQL (I use a GUID as the file name so that multiple users can have the same file name with different content). Provided the files are accessible to the user it works out the same, but reduces the load on SQL and makes the DB a whole load easier to back up!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900