asp.net - VB/SQL issue - Object reference not set to an instance of an object -
new user here , forum posts have been useful me in past. have problem beginning annoy me , wondering if guys can lend me hand!
my problem piece of code:
private sub drpuser_databound(byval sender object, byval e system.eventargs) handles drpuser.databound dim newlabel label newlabel = page.master.findcontrol("lbla") me.drpuser.items.findbyvalue(newlabel.text).selected = true end sub
the server throws out 'object reference not set instance of object.' , references line 15, be: me.drpuser.items.findbyvalue(newlabel.text).selected = true
what don't when run debugger on workstation, code runs. pulls data server fine , identifies me. when change newlabel else, label2, give me object reference error , run fine.
but here's thing that's getting me. when switch label names , update server, error gives me references code still same old one! show newlabel when re-uploaded code renamed label2.
any thoughts? in advance...
you should use new keyword. code should
dim newlabel new label
Comments
Post a Comment