Click here to Skip to main content
15,895,011 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
hi Expert!!

i create windows application, in this i use 1 table for store company information and also wants to store Company Logo.

i fill table using SP, so in form side i pass parameter array and then i pass to the SP.

i use properties to set value of properties, but in return time which data type is use for c# form side. because its not support image data type.



THX....!!!
Posted
Comments
Lakshmimsridhar 15-Sep-12 6:42am    
hi, are you saving image path or image itself?
[no name] 15-Sep-12 6:50am    
image itself.

[no name] 15-Sep-12 6:50am    
path is quit easy to store as a string.:)

For binary image you should use byte data type or any object type.
Only thing you need to is conversion from binary to byte array & from byte array to binary. Refer this:
C# Image to Byte Array and Byte Array to Image Converter Class[^]

--Amit
 
Share this answer
 
Have a look at following links:
Store or Save images in SQL Server[^]
Storing and Retrieving Images from SQL Server Using Strored Procedures and C#.net[^]
Storing and Retrieving Images from SQL Server using Microsoft .NET[^]

It is not advisable to store images in the database, rather try storing them into a folder and retrieve them in your application. Store the image path in the database as a varchar instead of using BLOB or any other datatype.
 
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