Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > help needed

Reply
Thread Tools

help needed

 
 
nil
Guest
Posts: n/a
 
      11-30-2006
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.u i.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

 
Reply With Quote
 
 
 
 
Rad [Visual C# MVP]
Guest
Posts: n/a
 
      11-30-2006
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" <(E-Mail Removed)>
wrote:

>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.u i.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

--

Bits.Bytes.
http://bytes.thinkersroom.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Help Help Pentax S5i Help needed (Please) The Martian Digital Photography 14 06-20-2008 07:56 AM
Help Help Help Please Pentax S5i info needed The Martian Digital Photography 2 05-20-2008 07:00 AM
Help needed on this 857W config. Repost to be clearer what the problemsare and the help needed sparticle Cisco 3 08-30-2007 07:47 PM
Ideas needed & help needed! Ryan Macy Ruby 2 07-19-2006 08:04 PM
Microsoft small business server 2003 - help needed to understand what is needed to use it Dima Computer Support 5 10-20-2004 08:27 PM



Advertisments