Click here to Skip to main content
15,884,353 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I tried to convert the dataset to DataTable and DataView, but it wasn't helpful

I think this code must apply the deleting:

C#
string id = GV.SelectedRow.Cells[1].Text.ToString();

         using (DataSet dsStudentsSystem = new DataSet())
       {
        dsStudentsSystem.ReadXml(Server.MapPath("~/StudentsSystem.xml"));

 for (int counter = 0; counter < dsStudentsSystem.Tables["Students"].Rows.Count; counter++)
               {
                   if (dsStudentsSystem.Tables["Students"].Rows[counter]["ID"]==id)
                   {
                       dsStudentsSystem.Tables["Students"].Rows[counter].Delete();

                       dsStudentsSystem.AcceptChanges();

                   }
               }
 dsStudentsSystem.WriteXml(Server.MapPath("~/StudentsSystem.xml"));
               GV.DataBind();


But it's do nothing!
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900