Click here to Skip to main content
15,912,665 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I have small Doubt for Image upload, and Give me a proper coding.
ado.net connectivity is main error.

regards mohan
Posted

Here[^] is a perfectly good sample.
Searching on the internet will give you many more.
 
Share this answer
 
 
Share this answer
 
Here is the solution

HttpPostedFile file = fileImage.PostedFile;
byte[] bytPDF = new byte[file.ContentLength];
Stream objStream;
objStream = file.InputStream;
objStream.Read(bytPDF , 0, file.ContentLength);
string fileName = file.FileName.Trim();
 
Share this answer
 
Comments
Mohankumar.Engain 19-May-11 10:29am    
Thank u very much
Convert you image as byte[] and send the content to database of type image
 
Share this answer
 
Comments
Mohankumar.Engain 19-May-11 10:29am    
Thank u very much

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