I have an application in which a user will be saving information that will later be pulled up. Each 'Trial' will have its own XML file and within that XML file there will be specific events that are identified by an EventID and specific dogs competing in each event that will have their own DogID.
I need to find a way to check whether or not a specifric event or dog within a specific event has already been written to this file. Below is the code that will create this XML file for the very first time and then be updated when creates a specific event and dog for this file.
XmlWriter w = XmlWriter.Create(fs);
w.WriteStartDocument();
w.WriteStartElement("Event");
for (int counter = 0; counter < registeredEventCount; counter++)
{
string eventString = registeredArrayList[counter].ToString();
// eventString = eventString.Replace(" ", "");
w.WriteStartElement("Event");
w.WriteAttributeString("id", eventString);
// Write a product.
w.WriteStartElement("dogId");
w.WriteElementString("eventID", eventSelectComboBox.SelectedItem.ToString());
w.WriteElementString("ukcNumber", ukcDogNumTextBox.Text.ToString());
w.WriteElementString("breed", breedTextBox.Text.ToString());
w.WriteElementString("dogName", dogNameTextBox.Text.ToString());
w.WriteEndElement();
w.WriteEndElement();
}
w.WriteEndDocument();
w.Flush();
Any suggestions? I am having trouble finding an effient way to check whether an event has already been created and a dog has already been created wihtin an event.