help needed

N

nil

hello all...
i did one coding to bind an image in the datagrid but the problem is
that it binds every
image control with the last image in the dataset...actually i am
storing path in the oracle.



here's the coding that i did..

private sub dg_itembound(byval sender as object,byval e as
system.web.ui.webcontrols.datagriditemeventargs) handles db.itembound

dim i as integer

dim img as image

dim str as string

str="Select image from member_data where " & ddltype.selectitem.value &
"like initcap('"& txtsrch.text &"%')"

ds=dbconn(str)

for i=0 to ds.tables(0).rows.count-1 step 1

if e.item.itemtype=listitemtype.alteringitem or
e.item.itemtype=listitemtype.item then

img=ctype(e.item.cells(1).controls(1),system.web.ui.webcontrols.image)

img.imageurl=ds.tables(0).rows(i).item("item")

end if
next
end sub

i did above coding as when user searches for his profile by name..then
there may be more then one name user so i want to bind
the image in the grid..so please help me out..thanks in advance
 
R

Rad [Visual C# MVP]

That would be because the select condition for your sql never changes
-- it is always txtsrch.text

Is it possible to rewrite the query such that it fetches the image url
for each returned row?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top