Currently, the data set development mode and three-layer structure are used in the project.
Whether it is Layer 3 or not, the biggest advantage of using the data source control is:
1. I used to need multi-table join queries. Many of them can be used now. The data source control will automatically help you solve this problem.) Is it easy and pleasant?
For example, table A has three foreign keys: id1, Id2, and ID3. You only need to convert the three fields into a template, and then select the appropriate control to bind it to the three data source controls. OK. You will not worry about the rest.
2. secondly, the objdatasource in the data source control is indeed easy to use. Other data source controls are too simple or dedicated (sitemap). Only with the combination of three layers can the power of the data source control be fully realized. It can be written manually. I haven't met what objds cannot do yet. However, you need to change your mind. Implementation and manual writingCodeIt is indeed not the same. I now have one page of code. In the past, someone else used more than 1 K lines in the background of the project. Now I only used less than 400 lines. It cannot be said that objds still has advantages in some aspects.
3. in addition, when creating an adapter, pay attention to whether the generated data type is consistent with that of the database. In particular, the char (1) type is generally set to byte. If the code is correct, an error occurs, this problem often occurs. It will be okay to modify it.
4. A little idle and inconvenient. Today, I paid a weekly discount for dynamic queries with multiple conditions. For example, where C = @ C and B = @ B and D = @ D, where B, C, and D can be empty, and the tutorial method is useless. After studying it, either set filterexpression in the objds attribute or find a way to generate the adapter. The former is not easy to implement because it may be left empty. The other method does not support the SELECT statement. The specific method should be to create a stored procedure first, and then select an existing query in the new adapter. It is best to write the query of update and other operations together. In this way, you can use it smoothly.