import excel sheet with image to database getting error ( Clipboard does not exist current context)

Last Reply 14 days ago By dharmendr

Posted 14 days ago

 

 using (var img = Clipboard.GetImage())
            {
                using (var stream = new MemoryStream())
                {
                    img.Save(stream, System.Drawing.Imaging.ImageFormat.Jpeg);

                    return stream.ToArray();
                };
            };

 

You are viewing reply posted by: dharmendr 14 days ago.
Posted 14 days ago

Hi afrozeameera,

Clipboard class is in windows Forms namespace.

So add reference of System.Windows.Forms namespace and import in the page.

using System.Windows.Forms