With asp.net2.0 really can say that the programmer's fool era is coming in which the GridView bound to the database is too powerful to save countless code, kidnapping countless programmers, but Microsoft's things have a problem, that is, if not the default way, it is extremely troublesome to write, This is also one of the main reasons for its rejection, such as the GridView binding to database update deletion is very convenient, but if you bind to the XmlDataSource then only read, to update or delete the XML file, such as the real interactive features that is too much trouble. What's more, XmlDataSource's binding is weak! Only two tiers of XML files can be bound with attributes as columns! Obviously, this is totally impossible.
What do we do? To write the XML file back to the GridView ... The standard method. The first is to write the XML file code into the dataset to manually write the rules binding the dataset to the GridView and then rewrite the OnUpdate ondelete function of the GridView ... Write back XML file manually ... Very big project ... Just to use the GridView to change an XML file with only two elements!!!!
It must be admitted that the GridView was born for the database. But it works again. We want to use its powerful interface, editing function, then ... My method is to use the database table as a temporary table, the GridView or binding database before the GridView load the XML content through the import of the empty temporary table (through the Wizard of the dataset), after the completion of the changes in the full guide back to the XML file, This process looks troublesome, but in fact the code is just a few lines!
Of course, this loss of efficiency, but think of the red word on the section of it! What if there is no SQL Server? Yes, well, so can access.