I am working on a visual C# program for image processing.I am trying to add image to sql database using Visual C# (Windows forms) and ADO.NET.
I have converted the i
The selected file stream should be converted to byte array.
FileStream FS = new FileStream(filepath, FileMode.Open, FileAccess.Read); //create a file stream object associate to user selected file
byte[] img = new byte[FS.Length]; //create a byte array with size of user select file stream length
FS.Read(img, 0, Convert.ToInt32(FS.Length));//read user selected file stream in to byte array
Now this works fine. Database still shows < Binary data > but it could be converted back to image using memorystream method.
Thanks to all...