Asp.net2.0 the fastest way to implement the GridView update deletes an XML file __.net

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.