Well, what you are doing is storing the name of the file, not the file
itself. (Which is fine, actually).

When binding your GridView to the XML file, you *need to instruct the
GridView* to display the image with that name located at a particular
path. You could use an ImageField to do this or create a TemplateField
with an Img tag. If you do not do this, the GridView has no idea that
you wish to display an image in that column.

On May 23, 5:25 pm, "Nazrul ASP.Net Developer"
<[email protected]> wrote:
> Hi Friends,
>
> I have an XML file. Here is the XML file:
>
> <?xml version="1.0" encoding="utf-8" ?>
>
> <StudentsList>
>
>   <Student>
>     <SerialNo>1</SerialNo>
>     <Name>Arpita Das</Name>
>     <Description>I realized that UniSA students won prizes in many
> design competitions, so I transferred to UniSA for my Bachelor Degree,
> with credit (from my previous studies)</Description>
>     <Course>C#</Course>
>     <Photo>Res1.jpg</Photo>
>   </Student>
>
>   <Student>
>     <SerialNo>2</SerialNo>
>     <Name>Sonali kulkarni</Name>
>     <Description>Come to Adelaide - it is a perfect city to study,
> lots of fun and a wonderful city... what more do you need?</
> Description>
>     <Course>Java</Course>
>     <Photo>Res2.jpg</Photo>
>   </Student>
>
>   <Student>
>     <SerialNo>3</SerialNo>
>     <Name>Anup Jalota</Name>
>     <Description>The placement was of most interest to me since I
> consider it to be the best way to learn a profession like nursing. You
> can study and read - but it's not until you meet real people that you
> experience the effects of your actions</Description>
>     <Course>VC++</Course>
>     <Photo>Res3.jpg</Photo>
>   </Student>
>
>   <Student>
>     <SerialNo>4</SerialNo>
>     <Name>Madhuri Khanna</Name>
>     <Description>I want to use my knowledge and skills to help other
> people know more about information technologies, how they are changing
> daily life and the importance of them as real solutions to improve
> business.</Description>
>     <Course>J2EE</Course>
>     <Photo>Res4.jpg</Photo>
>   </Student>
>
> </StudentsList>
>
> -------------------------------------------------
> <Photo>Res4.jpg</Photo>
> It is wrong.
>
> The tage containing <photo> will store the image of the student.
> Images are stored in my folder directory.
>
> I want to show the image of the student in the grid.
>
> Ok, I show this data in a grid by writing code in Page_Load event.
> Here is the page load code.
>
>         DataSet ds=new DataSet();
>         ds.ReadXml(Request.PhysicalApplicationPath +
> "TrainedStudents.xml");
>         GridView1.DataSource = ds;
>         GridView1.DataBind();
>
> Anyone help me please.

Reply via email to