Click here to Skip to main content
15,900,818 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I am getting Option Strict On disallows implicit conversions from 'Boolean' to 'String' on [b]False[/b]

How do I solve this?

VB
If Not blnInvalid Then
    'Check if the citation is a duplicate
    strCitationNumbers = Msc.Integration.Mncis.Library.v4.Citation.GetCaseNumbersForCitation(strCitationNumber, False)
    If (strCitationNumbers(0) <> "No Matching Case") Then
    'add the error message
     CType(objXMLCitationNode, XmlElement).SetAttribute("validationError", "This is a duplicate citation.")
    End If
End If


What I have tried:

The following line of code is generation Option Strict On disallows implicit conversion from 'Boolean' to 'String'

VB
strCitationNumbers = Msc.Integration.Mncis.Library.v4.Citation.GetCaseNumbersForCitation(strCitationNumber, False)
Posted
Updated 16-Aug-16 7:46am

1 solution

The variable you are trying to update or the value to pass as a reference, is expecting a String value, but it gets a Boolean value.

You can do;

VB
strCitationNumbers = Msc.Integration.Mncis.Library.v4.Citation.GetCaseNumbersForCitation(strCitationNumber, "False")
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900