Click here to Skip to main content
12,241,950 members (48,627 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C#
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 15-Sep-12 1:38am
Comments
Lakshmimsridhar 15-Sep-12 6:42am
   
hi, are you saving image path or image itself?
tarun0702 15-Sep-12 6:50am
   
image itself.

tarun0702 15-Sep-12 6:50am
   
path is quit easy to store as a string.:)
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

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.
  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160426.1 | Last Updated 15 Sep 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100