Upload multiple images
Is it possible to store multiple images in a single row in database using asp.net?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Amitesh VermaPosted Aug 10, 2015, 6:33 AM
Upendra Pratap ShahiPosted Aug 10, 2015, 5:22 AM
for (int i = 0; i < sqlDt.Rows.Count; i++)
{
TableRow tRow = new TableRow();
TableCell tCell = new TableCell();
Image myImg = new Image
{
ImageUrl = sqlDt.Rows[i]["MyImagePath"].ToString(),
AlternateText = sqlDt.Rows[i]["Name"].ToString(),
Width = 100,
Height = 100
};
tCell.Controls.Add(myImg);
Label l = new Label
{
Text = "" + sqlDt.Rows[i]["Name"].ToString(),
};
l.Style.Add("font-weight", "bold");
l.Style.Add("text-align", "center");
tCell.Controls.Add(l);
tRow.Cells.Add(tCell);
count++;
if(count%2==0)
{
myTable.Rows.Add(tRow);
}
if(i==sqlDt.Rows.Count-1 && count%2!=0)
{
myTable.Rows.Add(tRow);
}
}
Rajeesh MenothPosted Aug 10, 2015, 4:27 AM