Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

help needed

0 views
Skip to first unread message

nil

unread,
Nov 30, 2006, 6:24:42 AM11/30/06
to
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

Rad [Visual C# MVP]

unread,
Nov 30, 2006, 1:33:23 PM11/30/06
to
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?

On 30 Nov 2006 03:24:42 -0800, "nil" <NileshTh...@gmail.com>
wrote:

--

Bits.Bytes.
http://bytes.thinkersroom.com

0 new messages