简体   繁体   English

我应该为特定用例实现数据源控件吗?

[英]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.

相关问题 是否有与可编写脚本的Java小程序等效的.Net技术? (针对特定用例) - Is there a .Net technology equivalent to scriptable Java applets? (for a specific use-case) `CancellationTokenSource.TryReset` 的用例是什么? - What is the use-case for `CancellationTokenSource.TryReset`? 应该为数据类实现构造函数还是使用默认构造函数? - Should I implement a constructor or use the default one for data classes? C#中的朋友类用例的解决方法 - Workaround for an use-case of friend classes in C# 我应该为用户控件实现IDisposable吗? - Should I implement IDisposable for a User Control? Mongo DB GridFS +文档事务(典型用例) - Mongo DB GridFS + Document transaction (typical use-case) 我应该为此用例使用任务或线程吗? - Should I use Tasks or Threads for this use case 我应该如何在源代码管理中处理项目中的秘密值? - How should I handle secret values in a project in source control? 我应该将 dotnet-tools .config 目录检查到源代码管理中吗? - Should I check the dotnet-tools .config directory into source control? 异步读取HttpWebRequest的响应流的好用例是什么? - What is a good use-case for reading a HttpWebRequest's response stream asynchronously?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM