Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i know its an old question and i looked around many solution same as mine but never worked with me
system out of range ! even i try to call it by index

What I have tried:

if (dReader.HasRows)
{

byte[] previewBytes = (byte[])dReader["Img"];
if (previewBytes != null)
{
context.Response.BinaryWrite(previewBytes);
}
}
Posted
Updated 5-Oct-18 5:39am

Please Read this article[^]


Here's explained nicely. I'm Sure you will get your answer.
 
Share this answer
 
its done Thanks
here is it if someone needed it
using (SqlDataAdapter sda = new SqlDataAdapter(strGet, _con))
         {
             DataTable dt = new DataTable();
             sda.Fill(dt);
             byte[] bytes = (byte[])dt.Rows[0]["Img"];
             context.Response.BinaryWrite(bytes);
             context.Response.End();
         }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900