How to add image to sql server database ?
-
I'm new in the database world... I want to know if its possible to add image ( simple bitmap or jpeg ) to the database ? If this is possible => how can i get and set the image from C# code ? Thanks for the help.
Hi, There is an "image" data type in SQL Server which is basically a binary datatype. http://msdn.microsoft.com/en-us/library/ms187993.aspx[^] Storing binary inside a database is generally strongly advised against though. Before you do that you might want to check if using the filesystem could be a better solution.
-
Hi, There is an "image" data type in SQL Server which is basically a binary datatype. http://msdn.microsoft.com/en-us/library/ms187993.aspx[^] Storing binary inside a database is generally strongly advised against though. Before you do that you might want to check if using the filesystem could be a better solution.
Yes you can insert image or retrieve it from your Database by using BLOB(binary Large object) approach in which an image file is convert into Binary data which is compatible to store data in Database. Google has a lots of resource for this purpose. whatever i suggest you to move for this given link Save An Image Into SQL Server 2000 Database[^]
-
Hi, There is an "image" data type in SQL Server which is basically a binary datatype. http://msdn.microsoft.com/en-us/library/ms187993.aspx[^] Storing binary inside a database is generally strongly advised against though. Before you do that you might want to check if using the filesystem could be a better solution.
Tony Pottier wrote:
Storing binary inside a database is generally strongly advised against though
I disagree on the "generally strongly" advice. Manageability, consistency, security, reliability, portability are all reasons for storing binaries in the database. Storing binaries in the database means that you have db-enforced referential integrity, one point of entry for the backup, one place to set security...
"When did ignorance become a point of view" - Dilbert
-
I'm new in the database world... I want to know if its possible to add image ( simple bitmap or jpeg ) to the database ? If this is possible => how can i get and set the image from C# code ? Thanks for the help.