मैं XML
पर नया हूं और निम्नलिखित की कोशिश की लेकिन मुझे अपवाद मिल रहा है। क्या कोई मेरी मदत कर सकता है?यह ऑपरेशन गलत तरीके से संरचित दस्तावेज़ बना देगा
string strPath = Server.MapPath("sample.xml");
XDocument doc;
if (!System.IO.File.Exists(strPath))
{
doc = new XDocument(
new XElement("Employees",
new XElement("Employee",
new XAttribute("id", 1),
new XElement("EmpName", "XYZ"))),
new XElement("Departments",
new XElement("Department",
new XAttribute("id", 1),
new XElement("DeptName", "CS"))));
doc.Save(strPath);
}
में मिलता है आप क्या त्रुटि की क्या ज़रूरत है के लिए नीचे देखें के लिए नीचे देखें? –