Link to home
Start Free TrialLog in
Avatar of arunatata
arunatata

asked on

option strict disallows implicit conversions from system.object to string

I have both option strict and option explicit turned on in my project. When i build it i get the following error:

" option strict disallows implicit conversions from system.object to string"

I am getting this error for the piece of code below:

            If DataReader.Read() Then

                PersonCheckingOut.Text = DataReader("NameCheckingOut") 'on this line
                Reason.SelectedValue = DataReader("ReasonCheckedOut")  'on this line
                TesterName.Text = DataReader("TesterUsedOn")                 'and on this line as well..

           end if

What is the solution for this?
Avatar of deepaklakhani
deepaklakhani
Flag of United States of America image

try this:


TesterName.Text = DataReader("TesterUsedOn").ToString()
ASKER CERTIFIED SOLUTION
Avatar of deepaklakhani
deepaklakhani
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial