Tuesday, 9 July 2013

how to upload a image into database




Byte[] imgByte = null;
        if (fileup.HasFile && fileup.PostedFile != null)
        {
            HttpPostedFile File = fileup.PostedFile;
            imgByte = new Byte[File.ContentLength];
            File.InputStream.Read(imgByte, 0, File.ContentLength);
        }
        empdetails.image = imgByte;

No comments:

Post a Comment