I have a book database where i have book information. I have a row where i store the name of the picture of the book i want to display on the page. For example cprog.jpeg
Now, i want to append that name to the src to display the picture. However, its just displaying the name itself. Im not quite sure how to do it.
+ " <img src=\"{0} \">" + row[8].ToString() + "</div>"
Here is the complete code..
foreach (DataTable table in dsgrid2.Tables)
{
foreach (DataRow row in table.Rows)
{
strBooksInCategory +=
"<div style=\"height:150px;\">"
+ " <img src=\"{0} \">" + row[8].ToString() + "</div>"
+ " <div style=\"height:110px;float:left;padding-left:10px;\">"
+ " <div style=\"height=auto;left-margin:10px;\">" + row[0] + "</div>"
+ " <div style=\"height=auto;left-margin:10px;\">" + row[1] + "</div>"
+ " <div style=\"height=auto;left-margin:10px;\">" + row[2] + "</div>"
+ " <div style=\"height=auto;left-margin:10px;\">" + row[3] + "</div>"
+ " <div style=\"height=auto;left-margin:10px;\">" + row[4] + "</div>"
+ " <div style=\"height=auto;left-margin:10px;\">" + row[5] + "</div>"
+ " </div>"
+ "</div>";
strBooksInCategory += "<div style=\"height:10px;width=100%;\"></div>";