|
I have a database with some fields,along with this fields an image field with datatype image is tehre.But after saving all details into the db.the saved data will be displayed on a grid.But whn i tried to retrieve the data by selecting into a grid row the text fields are coming properly.But the image will be displayed only the first photo that i uploded.Only one image will be displayed for all the rows.What is the reason I attach the image retreival code in the rowcommand of the grid.
DataTable dt = new DataTable();
dt = insunit.GetUnit(id);
Img_Logo.ImageUrl = d.Rows[0]["UnitLogoPath"].ToString();
The Getnit() is to retriving data from the table..
|
|
|
|
|
Hey you hav to use for loop for this..
Try this..........
DataTable dt = new DataTable();
dt = insunit.GetUnit(id);
for(int i=0; i< dt.row.count; i++)
{
Img_Logo.ImageUrl = d.Rows[i]["UnitLogoPath"].ToString();
}
it will be work...
Bye Bye.
Nisar Inamdar.
Always For U
|
|
|
|
|
Thanks for ur reply ....
But the pbm occurs in saving the image.All images in the db are same.How this happens.
|
|
|
|
|
SreejithAchutan wrote: DataTable dt = new DataTable();
dt = insunit.GetUnit(id);
Img_Logo.ImageUrl = d.Rows[0]["UnitLogoPath"].ToString();
Hey what you have done here ??
Can you try to figure out ?
DataTable dt = new DataTable();<br />
dt = insunit.GetUnit(id);<br />
Img_Logo.ImageUrl = d.<big>Rows[0]</big>["UnitLogoPath"].ToString();
Here you are taking only first rows value...
Change it..
If possible bind data in RowDataBound Event of gridview.
On every row find appropriate data and bind it properly.
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
The pbm occurs is not in the rows.But the image saved is same in the db.Why the image saved is same in the db....
|
|
|
|
|
Hai
I need to access the asp:image inside asp:GridView ItemTemplate in .cs file. How can i set the imageurl Dynamically, based on conditions? The Grid view data binding is from the Database using dataset.
please help me
|
|
|
|
|
My suggestion is , In row bound function u can add the columns dynamically
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|
Hi
Create a function in code behind and pass image name to that function.
and in item template om set image url property to the function name.
<asp:image id="imgreply" runat="server" imageurl=""><![CDATA[<%# Thumbnail(Container.Dataitem("reply_imgname")) %>]]>'></asp:image>
and in code behend this id thumbnail function.
Function Thumbnail(ByVal img_name As String)<br />
If img_name <> "" Then<br />
Dim urlThumbNail As String = "thumbnails.aspx?iname=" & img_name<br />
Return urlThumbNail<br />
Else<br />
<br />
End If<br />
End Function
thumbnail.aspx is the name of the page where thumbnail of the image is
created.You can easily get the code for thumbnail if u havn't got
the reply me.
Regards.
Rahul
People Laugh on me Because i am Different but i Laugh on them Because they all are same.
|
|
|
|
|
Thanks Rahul
It helps a lot to complete my work
|
|
|
|
|
Welcome Niya.
Regards.
Rahul.
People Laugh on me Because i am Different but i Laugh on them Because they all are same.
|
|
|
|
|
hi...
i'm new in Asp.net..
i want to source code for online exam..
i'm using ASP.net & C# coding..
plz...
any one help me..
advance
Thanks,
For ur infor...
|
|
|
|
|
what you want tell me!
Thanks & Regards
Niranjan
|
|
|
|
|
i want sample coding for online exam proj in asp.net with c#..
do u know any website?
|
|
|
|
|
Hey,
here you can get idea about your queries..
Not source code..
For that try google...
Hope it will save your time.
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
ok...
do u know any good tutorial or website?
i wanna sample code of online-exam proj in asp.net using c#..
|
|
|
|
|
Hi,
there isnot anything on google ??
You can easily help yourself by doing your own homework, and trying to learn something instead of sitting back waiting for others to do it all for you.
So just start..
Try..
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
|
Hey,
try this.. it will help you..
Link[^]
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
thank u boss..
i will try..
|
|
|
|
|
Hi Guys & Girls,
Currently I am using VS2003 version,
I like to use ajax codes for my projects...,
Anyone plz guide me some good sites to learn abt ajax with vs2003,
Plz help me,
Thanks & Regards,
Mageshh,
please don't forget to vote on the post
|
|
|
|
|
|
iam desiging tool tip using a css style sheet. now this tool tip i want to add to the grid view how it is possible
|
|
|
|
|
Hi,
Why posting same message these many times ?
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
You are right!
Thanks & Regards
Niranjan
|
|
|
|
|
I want to display only one product from database for every 10 minutes.Please help very urgent
|
|
|
|