Most of the books introduced on the market generally refer to datacontrol such as sqldatasouce, gridview, detailview, and so on. Of course these are very convenient and can be used at leastProgramCodeTo delete the query. However, in fact, it is not as good as you think during project development. You will not always be able to process new modification and deletion queries for a single data table. What should I do if I want to process more than two data tables ??
In ASP. NET 2.0, an objectdatasouce is added, which allows us to write data through our own programs or developed objects when processing data.
Let's look at the following:
1. sqldatasouce:
Sqldatasouce uses four command settings: Select, insert, update, and delete to access data.
2. Use objectdatasouce
Objectdatasouce is processed by the specified category and the method (function/Sub) written in the category. Select must return the result, the returned results can be written in the following ways: datareader, dataset, able, davaview, and collection objects (object set. gridview1.datasouce = XXXX indicates the type that can be passed in. Other insert, update, and delete operations must be used together to transmit the data to be maintained and access data through ADO. net.
3. Use objectdatasouce with Business Object (*. dll/class)
You can extract the data access and some commercial logic, write them into some commercial objects, and then write a category to use these commercial objects to combine them with objectdatasouce.
Here we can understand that using objectdatasouce, you can write your own program for data access. The ability to write programs according to their own needs, so that the system can be more flexible applications. You can also use the datasouce mechanism to integrate with data control items (such as gridview, detailview, and formview. This allows you to reduce programs and make applications more convenient. It can be said that it has the freedom of ADO. Net and the convenience of datasouce ].
As for how to write the 2.3 method, we willArticle.
Pai_^