Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#ASP.NET
Hi....
 
I Am Retrieving Data From Database And Displaying In Table Dynamically
For That I Had used The Code in .cs file
 
 StringBuilder b = new StringBuilder();
        
  b.Append("<table style="background-color:#f3f3f3; border: #336699 3px solid; ");<br mode="hold" />        b.Append("width:750px; font-size:10pt; font-family:Verdana;" cellspacing="0" cellpadding="3">"); 
 
b.Append("<tr><td colspan="4" style="background-color:#336699; color:white;">");
        b.Append("Product Details"); b.Append("</td></tr>");
        b.Append("<tr><td style="width:80px;">Product Name</td>");
        b.Append("<td style="width:350px;">Product Description</td>");
        b.Append("<td style="width:50px;">Product Price</td>");
        b.Append("<td style="width:200px;">Product Image</td></tr>");
 b.Append("<tr>");
        b.Append("<td>" + table.Rows[0]["ProductName"].ToString() + "</td>");
        b.Append("<td>" + table.Rows[0]["ProductDescription"].ToString() + "</td>");
        b.Append("<td>" + table.Rows[0]["ProductPrice"].ToString() + "</td>");
      
        b.Append("<td>" + table.Rows[0]["ProductImage"].ToString() + "</td>");  // Here I am unable to Display The Image ..I Had Tried A lot by giving the                                                                                                                                       Imageurl..but it is not possible.

        b.Append("</tr></table>");
pls Help me....
Posted 21-Jan-13 1:36am
Edited 21-Jan-13 1:43am
v2
Comments
CHAITANYA KIRAN KASANI at 21-Jan-13 7:39am
   
Hi....
 
I Am Retrieving Data From Database And Displaying In Table Dynamically
For That I Had used The Code in .cs file
 
StringBuilder b = new StringBuilder();

b.Append("<table style='background-color:#f3f3f3; border: #336699 3px solid; ");
b.Append("width:750px; font-size:10pt; font-family:Verdana;' cellspacing='0' cellpadding='3'>");
 
b.Append("<tr><td colspan='4' style='background-color:#336699; color:white;'>");
b.Append("Product Details"); b.Append("</td></tr>");
b.Append("<tr><td style='width:80px;'>Product Name</td>");
b.Append("<td style='width:350px;'>Product Description</td>");
b.Append("<td style='width:50px;'>Product Price</td>");
b.Append("<td style='width:200px;'>Product Image</td></tr>");
 

b.Append("<tr>");
b.Append("<td>" + table.Rows[0]["ProductName"].ToString() + "</td>");
b.Append("<td>" + table.Rows[0]["ProductDescription"].ToString() + "</td>");
b.Append("<td>" + table.Rows[0]["ProductPrice"].ToString() + "</td>");

b.Append("<td>" + table.Rows[0]["ProductImage"].ToString() + "</td>"); // Here I am unable to Display The Image ..I Had Tried A lot by giving the Imageurl..but it is not possible.
 
b.Append("</table>");
 
pls Help me....
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hi,
 
may be it ll help you :
 
Store or Save images in SQL Server[^]
  Permalink  
v2
Comments
Marcus Kramer at 21-Jan-13 9:37am
   
Just updated your answer to link to the original article that exists here on Code Project. The link you provided was to a plagiarized version of the article.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Hi,
 
You can use Image handler for converting Binary data to images.
 
Search for that. if you need further help i will
 
Thank you
  Permalink  
Comments
CHAITANYA KIRAN KASANI at 21-Jan-13 9:29am
   
Ya but...where to use image handler...i used In The Place Of "ProductImage"...But It is Showing error "WebService call Failed:500"...i am unable to understand where to use image handler...
sijo 2 at 21-Jan-13 9:33am
   
you need to follow the steps
create the image handler
in the source page where you want the image use it.
 
CHAITANYA KIRAN KASANI at 21-Jan-13 9:49am
   
created image handler...i wanna display it in a table dynamically...so i had taken like this:
b.Append("<td>" + table.Rows[0]["ProductImage"].ToString() + "</td>");
here in the place of "ProductImage" I used ImageHandler i.e., "ShowImage.ashx?id="+ProductID. But It SHowing The error "WebService call Failed:500"

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 718
1 OriginalGriff 421
2 Tadit Dash 355
3 sanket saxena 329
4 Peter Leow 193
0 Sergey Alexandrovich Kryukov 12,109
1 OriginalGriff 7,326
2 Peter Leow 5,003
3 Abhinav S 4,003
4 Maciej Los 3,575


Advertise | Privacy | Mobile
Web02 | 2.8.140421.2 | Last Updated 21 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid