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.
Xdocument to integer
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

VulpesRank #55 · 29.2K reputationPosted Sep 11, 2012, 2:30 PM EDT
int totTran = (int)pacDet.Element("TotTran");
or, if it doesn't you can always use:
int totTran = Convert.ToInt32(pacDet.Element("TotTran").Value);