Skip to content

Display image from database dynamically

plazza sele

Asked Nov 10, 2010, 11:56 PM EST2 answers
Share
LinkedInX
Hi all. I try to establish a dynamic HTML table with data for an item. i am getting trouble showing the image for the item, i am getting my data

from the database, i have saved my image as image in the database, and i used byte[].
I have the following code for desplaying data:

protected void DDLitem_SelectedIndexChanged(object sender, EventArgs e)
{

var item = new ItemControl(); // this is in the BLL layer.

  // DDLGoods is a DropDownList. and the method returns a List

  List get = item.returnGoods(DDLGoods.SelectedItem.Text); var out = new StringBuilder();

  out.Append("");
   foreach (var v in get)
   { 

       out.Append("

       td>

");
    }
    out.Append("
Name:Designation:Price:Item Number:
" + v.name + "" + v.designation + "" + v.price + "" + v.itimId + "</      
");
    Label1.Text= out.ToString();
}

 in the List get  i have objects, and each object contains images. here in the foreach loop v.image.

how can i display the image in the same out.append in the foreach loop.

 I need to wrigth in the foreach loop something that will display my v.image, can anyone please help me ???

can anyone help me please and finish my code with some/little comments on what is happening ?? 

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • Suthish Nair
    0
    where you streaming the image back from database?
    0
  • 0

    Hi.

    i don't know how to stream !! i am very new at this.

    i suppose to do this dynamically, but is there any controls that i can use in case 

    i never made it dynamically.!!?? 

    0