I try load a xml file (have DTD) into dataset, and bind it into datagrid (because i want to edit). when i call writeXML function, the scehema of my xml is different from the DTD..

how can i write based on my DTD?

{sorry for my bad english}

I don't think you can actually write it back using a DTD-- I think you can only use an XSD file. Once you load the file into a DataSet, it loses the DTD information and stores it in an XSD schema, I think. The WriteXML() method on a dataset does allow you to write the XSD schema to file, though...