Address Book Example video 169-175

+2 Christopher Piacente · December 28, 2014
Hello all,

I was hoping to get some help. I just learning C# and was running through the example that was provided on this site for the Address Book. Everything works great except for one piece. If I remove someone from the address book, their data does not get updated in the XML file. They still show up. I thought the "xNode.RemoveAll()" on closing would fix that but it doesn't. I can add new people just fine.

Any help would be greatly appreciated.

Thank you,

Chris

Post a Reply

Replies

Oldest  Newest  Rating
0 Donald Smithson · January 27, 2015
Replace what you have with this:
            try
            {
                nodes.RemoveAt(listView1.SelectedItems[0].Index);
                listView1.Items.Remove(listView1.SelectedItems[0]);
            }
            catch
            {
            }
0 Eugene Botma · January 11, 2015
just calling xNode.RemoveAll() will remove it from the XML object in your program. You still need to write these changes to the XML file, as you do when you add someone to the file.
  • 1

C#

107,352 followers
About

C# is an object-oriented language designed for improving the development of web applications.

Links
Moderators