Link to home
Start Free TrialLog in
Avatar of Dinesh Bali
Dinesh Bali

asked on

Get byte[] from IQueryable<byte[]>

Hi,

I am working on C#, ASP.net application.


I am getting IQueryable<byte[]> from the query.
I need byte[] bytes to pass into the method Read to get the real document.

Please advise the solution


IQueryable<byte[]> AWBFile = from x in repository.Select() where x.OrderCode == ordercode && x.TrackingNumber == trackingNumber select x.AWBimagefile;

byte[] bytes = AWBFile //  Get bytes[] from here
docFromUrl.Read(bytes);

Open in new window


Thanks
ASKER CERTIFIED SOLUTION
Avatar of Lukasz Zielinski
Lukasz Zielinski
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Dinesh Bali
Dinesh Bali

ASKER

Thanks

You mean I need to proceed as

byte[] bytesArr = AWBFile.ToArray();

foreach(var i in bytesArr)
{
  docFromUrl.Read(i);
}

Open in new window

Hi,

I do not know what docFromUrl is and how it's .Read() methods works.
But my guess is that this should be enough:

byte[] bytesArr = AWBFile.ToArray();
docFromUrl.Read(bytes);
Many thanks for your help.
Solution worked.
glad to be helpful!

ziolko.