Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi All,

string strPhoto = Request.Form["imageData"]; //Get the image from flash file

byte[] photo = Convert.FromBase64String(strPhoto);

insert into table values('" + photo + "') and Datatype of Colum is Image

Infact it is saved...But all the images are saved with exactly
same bits like this ==>
VB
0x53797374656D2E427974655B5D
0x53797374656D2E427974655B5D


Thanks in Advance.
Posted
Updated 11-Jul-11 1:03am
v2

1 solution

Use SqlParamenter[^] for the binary data.

See also C# Save and Load Image from Database[^] and Save An Image Into SQL Server 2000 Database[^].

Hope it can help :-)
 
Share this answer
 
Comments
Mathews Davis 11-Jul-11 7:46am    
The link was good.. But it didnt solve my problm!!!
Kim Togo 12-Jul-11 10:59am    
The thing I do not understand you do, is storing the image in a String class. Is it not already a byte array?

byte[] photo = (byte[])Request.Form["imageData"];

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