Hi,
You may receive this error in the scenario when you add a schema using the "Add Generated Metadata" and you promote the attribute or elements either as distinguished or as property promoted. Now when you are assigning any value or doing any comparison where the type or the distinguished field is to be changed "YOU WILL RECEIVE THIS ERROR".
Resolution: You need to use this paramter as below : --
InCorrect:
sbExMessage.Append("\n\nError Code: " + Msg_SQLResponse.parameters.Response.ErrorCode);
Correct:
sErrorCode = Msg_SQLResponse.parameters.Response.ErrorCode;
sbExMessage.Append("\n\nError Code: " + sErrorCode);
Regards
Vishnu