tags:

views:

152

answers:

4
+1  Q: 

about xml in c#

Hi , At present I’m developing a registration form in which, when we click on the save button. It will get save in a xml file. The details in the xml file should be displayed in the datagrid in separate window form. There are also three buttons. Edit, new and delete. On clicking on edit button, the selected rows detail in gridview should display in the registration form. I don’t know how to do this.

By selecting a row, when we click on delete button , it should delete that particular record from the xml file. This also I’m not getting……….. please help me………………………………..

Regards,

Manikandan.S

+7  A: 
Mahin
You should've pasted the link as let google that for you. Hehe
Raúl Roa
:)Exactly mate.. It was just second result. Now let me correct it.So Let me google that for you (http://lmgtfy.com/?q=asp.net+grdivew+add%2Cupdate%2Cdelete+in+xml).
Mahin
Of course is the second result. The first result is this question!
Raúl Roa
+2  A: 

Choose DataSet class.

SUMMARY:

A DataSet can read and write data and schema as XML documents. The data and schema can then be transported across HTTP and used by any application, on any platform that is XML-enabled. You can save the schema as an XML schema with the WriteXmlSchema method, and both schema and data can be saved using the WriteXml method. To read an XML document that includes both schema and data, use the ReadXml method.

In a typical multiple-tier implementation, the steps for creating and refreshing a DataSet, and in turn, updating the original data are to:

  1. Build and fill each DataTable in a DataSet with data from a data source using a DataAdapter.
  2. Change the data in individual DataTable objects by adding, updating, or deleting DataRow objects.
  3. Invoke the GetChanges method to create a second DataSet that features only the changes to the data.
  4. Call the Update method of the DataAdapter, passing the second DataSet as an argument.
  5. Invoke the Merge method to merge the changes from the second DataSet into the first.
  6. Invoke the AcceptChanges on the DataSet. Alternatively, invoke
    RejectChanges to cancel the changes.
adatapost
+2  A: 

Why don't you use a serializeable object then you can work with an object in your form and whenever you want you can serialize it to a file or into a db field. There's a utility called XSD.exe that lets you build a serializeable object model from a xml.

Beatles1692
A: 

I guess this is what you want to do at the end. XML - Insert/Update/Delete/Query

Hope this helps! Please let me know!

Will Marcouiller