I have successfully converted image to binary and saved it into the database using linq to sql WPF and now i want to retrieve it back to image format and save it to a specific f
First of your code to read the image is way to complex, you're opening it as a Stream and reading well, all bytes. There's a method that does exactly that so you can replace your whole ConverImageToBinary method with
img.image = File.ReadAllBytes(_txtFileName.Text);
Also you never "converted" anything to anything, an image is just an array of bytes on disk, you've read it, saved it to the database, if you read it back and save it back (using this time File.WriteAllBytes) it will work just fine, so
IF you want to write to the disk then just save the image back to disk as such:
File.WriteAllBytes(@"d:\myfile.bmp",img.Image.ToArray()) ;
And make sure you change the extention to match your file type (so bmp for a bitmap jpg for a jpeg etc)