简体   繁体   中英

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. 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.

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 ? You configure it by providing the the names of your C# methods responsible for the CRUD operations. Then in your methods you can do whatever you want.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM