Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all articles
Browse latest Browse all 935

How do I solve Cannot implicitly convert type 'uint' to 'int'. An implicit conversion exists(are you missing a cast?)

$
0
0

 I need help solve Cannot implicitly convert type 'uint' to 'int'. An implicit conversion exists(are you missing a cast?)

The following line of code is working fine, however a during code review, I was asked to replace this line of code with a different one. The new line suggested is not working because I am getting the above error. 

How to I make this new line of code work?

Here is the line that is working

objPrepHearDoc.Hearing.HearingKey = Convert.ToInt32(aobjXmlInputDoc.DocumentElement.SelectSingleNode("Case/Hearing[@ID=" + strEventId + "]/@ID").InnerText);

Here is the suggested code change that is not working and generating cannot implicitly convert type 'uint' to 'int'. An implicit conversion exists(are you missing a cast?) 

objPrepHearDoc.Hearing.HearingKey = Convert.ToUInt32(strEventId); 


Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>