[英]Should I implement a Data Source Control for a specific use-case?
I'm in a situation where I have no choice but to use Data Source controls. 我处于只能选择使用“数据源”控件的情况。 I'm using Infragistics user controls and their grids rely heavily on Data Source Controls to get the job done. 我正在使用Infragistics用户控件,其网格严重依赖于数据源控件来完成工作。 But, as is my experience with Data Source controls, once I need to get down to the nitty gritty and insert some special logic on the insertions, updates and deletes, I hit a roadblock and end up having to write some SQL queries using and SQL Data Source. 但是,根据我在数据源控件中的经验,一旦我需要深入了解并在插入,更新和删除操作中插入一些特殊的逻辑,便遇到了障碍,最终不得不使用和SQL编写一些SQL查询。数据源。
I would like to keep all logic in my code as much as possible. 我想在代码中尽可能保留所有逻辑。 I found a tutorial for implementing my own Data Source controls, but before I delve into it I want to know. 我找到了实现自己的数据源控件的教程 ,但是在深入研究之前,我想知道。 Is writing a specific Data Source control for a particular use case to leverage some special logic that can't easily be done otherwise acceptable? 是否为特定用例编写了特定的数据源控件,以利用某些原本无法接受的特殊逻辑?
Have you looked at ObjectDataSource
? 您看过ObjectDataSource
吗? You configure it by providing the the names of your C# methods responsible for the CRUD operations. 通过提供负责CRUD操作的C#方法的名称来配置它。 Then in your methods you can do whatever you want. 然后,在您的方法中您可以做任何您想做的事情。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.