Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This is my code in aspx file


<%=tours_post%>
<%--<table><tr><td>
<img>
</div>
<h3></h3>
<p></p>
</td></tr></table>--%>

This is the code in cs file


tours_post+= "<img>" + dt_tours1.Rows[1][1] + "</img>"
+
"<h3>" + dt_tours1.Rows[1][2] + "</h3>" +
"<p>" + dt_tours1.Rows[1][3] + "</p>";

I can access <h3> and <p> tag but how to get image from database.
Posted

Why are you making it complex?

You already have the DataTable with all the image, I believe. So, just bind that to a GridView or DataList or Repeater.
 
Share this answer
 
If your datatable consists image url, then you should try something like this:
C#
tours_post+= "<img src="" + dt_tours1.Rows[1][1] + "" />"
+
"<h3>" + dt_tours1.Rows[1][2] + "</h3>" +
"<p>" + dt_tours1.Rows[1][3] + "</p>";


   --Amy
 
Share this answer
 
I am designing a carousel using javascript and retriving data from data base. I am able to get h3 and p using <img>" + dt_tours1.Rows[1][1] + "</img>" only the name of image appears, but not the image.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900