In a C# 2010 application, I have the following value obtained from an Xdocument,
pacDet.Element("TotTran").Value.
I would like to know how to change this xdocument type to an integer data type.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Sep 11, 2012, 6:30 PM
int totTran = (int)pacDet.Element("TotTran");
or, if it doesn't you can always use:
int totTran = Convert.ToInt32(pacDet.Element("TotTran").Value);