Bassicly im creating a schedule where the user can input his on time such as 19/4/2012, and it gets saved into an xml file such as 19/4/2012. Im trying to perform an action that if the user enters information that has already been entered into the xml file then display a error. Im still unsure how to do such a task so any help would be appreciated thanx.
Example of xml:
<Schedule>
<Date>19/4/2012</Date>
</Schedule>
Code Example:
private void button1_Click(object sender, EventArgs e)
{
XmlDocument doc = new XmlDocument();
doc.Load("xmldoc.xml");
XmlNode schedule = doc.CreateElement("Schedule");
XmlNode date = doc.CreateElement("Date");
date.InnerText = monthCalendar1.SelectionStart.ToString();
schedule.AppendChild(date);
doc.DocumentElement.AppendChild(schedule);
doc.Save("xmldoc.xml");
if(date.InnerText == monthCalander1.SelectionStart.ToString())
{
label6.Text = "Incorrect";
}
}
}