how to convert image into binary format and store it into binary format in sql server. image is captured by webcam and retrive from another page on image control. i want to convert into binary and want to store that image into sql server database in binary format.
also need if image control is blank image control should be validate.
below is my code to convert image into binary.
- var WebClient = new WebClient();
- byte[] imgbytes = WebClient.DownloadData(image);
- MemoryStream ms = new MemoryStream();
- byte[] imgtobinary = new byte[ms.Length];
- ms.Position = 0;
- ms.Read(imgtobinary, 0, (int)ms.Length);
- if (!string.IsNullOrEmpty(image))
- {
- }
can anyone help me...?

Bhavesh VankarPosted Dec 22, 2020, 6:38 AM
Sachin SinghPosted Dec 21, 2020, 12:32 PM