Upload multiple images
Is it possible to store multiple images in a single row in database using asp.net?
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Rajeesh MenothRank #118 · 18.4K reputationPosted Aug 10, 2015, 12:27 AM EDT
Upendra Pratap ShahiRank #329 · 7.5K reputationPosted Aug 10, 2015, 1:22 AM EDT
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);
}
}
Amitesh VermaRank #2,535 · 552 reputationPosted Aug 10, 2015, 2:33 AM EDT