I am trying to create a database driven page where all labels and images
come from the database. I am trying to do it the following way:
Try
'Open the connection and execute the Command
objConnection.Open()
objReader = objcommand.ExecuteReader()
While objReader.Read()
objReader("labelName").ImageUrl = "images/" & objReader("content")
End While
Catch err As Exception
divError.InnerHtml = err.ToString()
End Try
The error that I get is:
System.MissingMemberException: Public member 'ImageUrl' on type 'String' not
found. at
Microsoft.VisualBasic.CompilerServices.LateBinding .InternalLateSet(Object o,
Type& objType, String name, Object[] args, String[] paramnames, Boolean
OptimisticSet, CallType UseCallType) at
Microsoft.VisualBasic.CompilerServices.LateBinding .LateSetComplex(Object o,
Type objType, String name, Object[] args, String[] paramnames, Boolean
OptimisticSet, Boolean RValueBase) at SellTiona.LoginForm.Page_Load(Object
sender, EventArgs e)
Does anyone know how to get around the issue of objReader("labelName")
coming back as string. I looked into converting it to image type but could
not figure out how to do it