hi i am having a page where on load i need to retrieve an image and some values from table (sql server) i am able to retrieve the data but i am getting an error while retriving the image
string Id = Request.QueryString["cproduct_id"];
String strConnString = System.Configuration.ConfigurationManager.ConnectionStrings["conString"].ConnectionString;
SqlConnection connection = new SqlConnection(strConnString);
SqlDataAdapter sda = new SqlDataAdapter();
DataTable dt = new DataTable();
connection.Open();
SqlCommand command = new SqlCommand("select iProduct_Image from Product_image where cproduct_ID='"+Id+"'", connection);
sda.SelectCommand = command;
sda.Fill(dt);
SqlDataReader dr = command.ExecuteReader();
dr.Read();
**Byte[] bytes = (Byte[])dt.Rows[0]["iProduct_Image"];
Response.Buffer = true;
Response.BinaryWrite(bytes);
Response.BinaryWrite((Byte[])dr[0]);
connection.Close();
**this is the error i am receiving " There is no row at position 0. "