Click here to Skip to main content
16,005,206 members
Home / Discussions / C#
   

C#

 
GeneralRe: Mix C++ and C# Pin
mav.northwind17-May-05 4:42
mav.northwind17-May-05 4:42 
GeneralRe: Mix C++ and C# Pin
Drusemark17-May-05 5:32
Drusemark17-May-05 5:32 
QuestionHow to modify the ..... Pin
Shankar Balaji10-May-05 3:01
Shankar Balaji10-May-05 3:01 
AnswerRe: How to modify the ..... Pin
MoustafaS10-May-05 5:30
MoustafaS10-May-05 5:30 
QuestionHow to Rotate Controls Pin
RajeshGuptha10-May-05 2:53
RajeshGuptha10-May-05 2:53 
GeneralSearching a particular node in XML Pin
Shankar Balaji10-May-05 1:45
Shankar Balaji10-May-05 1:45 
GeneralRe: Searching a particular node in XML Pin
Polis Pilavas10-May-05 2:42
Polis Pilavas10-May-05 2:42 
GeneralRe: Searching a particular node in XML Pin
Shankar Balaji10-May-05 2:58
Shankar Balaji10-May-05 2:58 
private void ImportXML(string path)
{

XmlTextReader reader = null;
try
{
reader = new XmlTextReader(Server.MapPath("../CheckList/"+strFileName));
}
catch
{
Response.Write("File Does'nt exists");
}

XmlDocument doc = new XmlDocument();
doc.Load(reader);
reader.Close();


XmlDocument docNew = new XmlDocument();
docNew.Load(path);



XmlNode oldCd = null;
bool Append = false;
XmlElement root = doc.DocumentElement;

oldCd = root.SelectSingleNode("//answers[@objectid=" + intValue + "]");
if(oldCd == null)
Append = true;


XmlNode CdNew;
XmlElement rootNew = docNew.DocumentElement;
CdNew = rootNew.SelectSingleNode("/answers[@objectid=" + intValue + "]");

XmlNode newBook = doc.ImportNode(CdNew, true);
XmlNode newNode = doc.DocumentElement.ChildNodes[1];

if(Append)
newNode.AppendChild(newBook);
else
newNode.ReplaceChild(newBook,oldCd);



try
{
doc.Save(Server.MapPath("../CheckList/"+strFileName));
}
catch
{
string strPath = Server.MapPath("../CheckList/") + "TempFile.xml";
ImportXML(strPath);
}



}

can u help me in another way to do this?
GeneralRe: Searching a particular node in XML Pin
Polis Pilavas10-May-05 3:12
Polis Pilavas10-May-05 3:12 
GeneralRe: Searching a particular node in XML Pin
Shankar Balaji10-May-05 3:22
Shankar Balaji10-May-05 3:22 
GeneralRe: Searching a particular node in XML Pin
Polis Pilavas10-May-05 3:24
Polis Pilavas10-May-05 3:24 
GeneralRe: Searching a particular node in XML Pin
Shankar Balaji10-May-05 3:34
Shankar Balaji10-May-05 3:34 
GeneralRe: Searching a particular node in XML Pin
Polis Pilavas10-May-05 3:44
Polis Pilavas10-May-05 3:44 
GeneralRe: Searching a particular node in XML Pin
Marc Clifton10-May-05 3:48
mvaMarc Clifton10-May-05 3:48 
Generalcrystal reports parameters Pin
boruu10-May-05 1:04
boruu10-May-05 1:04 
GeneralTAPI with C# Pin
ksanju100010-May-05 1:01
ksanju100010-May-05 1:01 
GeneralRe: TAPI with C# Pin
asif m@hmood10-May-05 2:07
asif m@hmood10-May-05 2:07 
GeneralRe: TAPI with C# Pin
ksanju100010-May-05 3:02
ksanju100010-May-05 3:02 
GeneralConvert Xml File to CSV File Format Pin
ksanju100010-May-05 0:56
ksanju100010-May-05 0:56 
GeneralRe: Convert Xml File to CSV File Format Pin
Polis Pilavas10-May-05 2:49
Polis Pilavas10-May-05 2:49 
GeneralExporting data of XML into Excel file Pin
ksanju100010-May-05 0:52
ksanju100010-May-05 0:52 
GeneralRe: Exporting data of XML into Excel file Pin
Polis Pilavas10-May-05 2:53
Polis Pilavas10-May-05 2:53 
QuestionHow to save word document ? Pin
Member 18788069-May-05 23:57
Member 18788069-May-05 23:57 
AnswerRe: How to save word document ? Pin
Polis Pilavas10-May-05 2:55
Polis Pilavas10-May-05 2:55 
Generalaccessing network folders/files Pin
Xiao_M9-May-05 23:37
Xiao_M9-May-05 23:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.