Avatar of duppypog
duppypog
Flag for United States of America asked on

using a function getting BC30451 error

I'm still coding in VS 2003, ASP.NET 1.1 because I work in the public sector and we have no money for training. I have one line of code, that calls one function that already works perfectly in other applications, but I cannot find one difference to figure out why it's not working here. The code uses a function to return an image.

The .apsx page reads:
<asp:Image Runat="server" Width="100" AlternateText="Photo Unavailable" ImageUrl='<%# GetImg(Container.DataItem("ImageID")) %>' ID="Image1" ></asp:Image>

The Function looks like this:
    Public Function GetImg(ByVal sImg As Object) As String
        Try
            With sImg
                If sImg Is DBNull.Value Then
                    sImg = "Imgs\nophoto.gif"
                Else
                    sImg = "http://www.hcso.org/Records/Images/" & sImg & ".jpg"
                    'Response.ContentType = "image/jpeg"
                    'Response.BinaryWrite(sImg)
                    'Response.End()
                End If
            End With
            Return sImg
            lblError.Text = sImg
        Catch ex As Exception
            lblError.Text = ex.ToString
        End Try
    End Function


Does anyone see any reason why this would not work like in the other apps???
Thank you!
ASP.NET

Avatar of undefined
Last Comment
duppypog

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
gery128

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
edemcs

I don't see why you;re using With sImg.  It serves no purpose there.
SOLUTION
duppypog

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
edemcs

No, after your Try.
SOLUTION
gery128

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
gery128

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
duppypog

ASKER
Will have to revisit this after I complete the NEW project I was given. I love switching gears mid-stream!
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck