+ 1
how can i write program with c# that show picture from sql server.?how can i store picture in sql server.?thank you
save picture in sql server
8 Answers
+ 3
Yes, I think you can use database storing for this purpose.
+ 2
If you use MS SQL Server you can use a field of varbinary(max) type to store your images.
But sometimes it is a better idea not to store images themselves in database, especially if the size of a file is more than 250K.
Rather than that you can store your images in your application folder, e.g. ...\AppFolder\images\, and have the full paths or just filenames of images in a usual varchar field in database.
+ 2
It depends on concrete case.
If you want to use in your application small thumb sized pictures it is OK and even more practical to store them in database. This way you can bind them to a column in datagridview or to picturebox etc. These might be small sized pictures of employees for example.
But if you want to do some image processing software which works with large amount of images than probably it is better to store them in folders?
+ 2
If you can not find varbinary type in your DBMS look either for image or binary or blob type.. all of these can store images and files.
I found this sample tutorial about how to use images from database in winforms app:
http://www.redmondpie.com/inserting-in-and-retrieving-image-from-sql-server-database-using-c/
I hope this can help you get started.
+ 1
thank you so much.yes i want just show me picture not processing.i want to create a program for my office that when programize my document,when click on that document show me picture of that
+ 1
thank you very much.
0
your mean is not using sql and use directly from software?
0
how could i do? there is no field in sql that store picture .in fact i dont know how store picture and get from that