hello friends,
i have a 4 to 5 textboxes and 2buttons to save and retrieve the values back, after clicking on save button all the textbox values should be saved in xml file,and when i click on retrieve button the values from xml file should be retrieved in listbox or listview.
could someone please help me.....
Loading


VulpesRank #55 · 29.2K reputationPosted Oct 17, 2014, 2:33 AM EDT
If it's creating an empty XML file then that suggests that the textboxes have not been placed on the form (as the code assumes) but are within some container such as a panel or groupbox.
If that's the case and the textboxes are in (say) panel1, change the code in btnSave_Click as follows:
VulpesRank #55 · 29.2K reputationPosted Oct 16, 2014, 10:55 AM EDT
// ....
If you're wondering why I'm iterating backwards through the controls collection to retrieve the textbox values, that's because (for some unknown reason) the VS designer adds them to the collection in the reverse order they were added to the form.
raju patil52 reputationPosted Oct 16, 2014, 8:52 PM EDT
and while retrieving back the values its showing:
InvalidArgument=Value of '0' is not valid for 'SelectedIndex'.
Rajendra TripathyRank #1,822 · 814 reputationPosted Oct 17, 2014, 2:34 AM EDT
raju patil52 reputationPosted Oct 17, 2014, 3:00 AM EDT
raju patil52 reputationPosted Oct 17, 2014, 3:01 AM EDT