Click here to Skip to main content
15,867,488 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
i m confuse.so please help me.
Posted
Comments
Nandakishore G N 6-Aug-14 9:47am    
Where is your question ? Please add some details about the it.
Improve the question by pasting what you have done till now?.
VishwaKL 10-Aug-14 23:08pm    
You want to convert image data to binary? or any data to binary?

See this Code project article. I assumed that you want to convert imgage data in to binary.

C# Image to Byte Array and Byte Array to Image Converter Class[^]
 
Share this answer
 
Comments
Gihan Liyanage 15-Sep-14 6:18am    
Did you got a solution from my support, I can see you have not accepted any answer.If you are ok with this answer plz accept it. Then any user having same problem can identified it has solved the problem..
C#
HttpRequestBase request = Request;
         if (request != null && request.Files.Count > 0 && request.Files[0] != null && request.Files[0].ContentLength > 0)
         {
             var file = request.Files[0];
             if (file != null)
             {
                 var path = Path.Combine(Server.MapPath("~/Content/images"), file.FileName);
                 file.SaveAs(path);
                 employee.UserImage = System.IO.File.ReadAllBytes(path);
             }
         }


...By This Way You Can Convert And Insert The Selected Image Path
 
Share this answer
 
v2

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