检测要更新的列

编程入门 行业动态 更新时间:2024-10-28 16:18:47
本文介绍了检测要更新的列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

大家好, 我有这个问题.... 页面中有很多文本框...如果我只更改一个文本框(任何文本框)的值来更新数据库,如何检测要更新的列?简而言之,我如何检测特定的文本框?或者我是否必须更新所有列所有文本框每次只更改一个文本框值? 问候并感谢....

Hi all, I have this question.... there are many text boxes in a page...if i change the value of only one text box(any text box) to update database, how can i detect which column to update???in short how can i detect that particular text box??or do i have to update all columns with all text boxes everytime i change only one text box value?? Regards and thanks....

推荐答案

这是一个应用程序设计问题。如果您使用的是ORMapper工具,那么大多数工具本身都会处理此问题。如果您没有使用任何OR映射工具,那么您必须在数据访问层实现该级别的智能。 DAL通常检查哪些列已更改(可能是每个字段的标志)并根据更改的字段生成更新sql。 希望这可以让您了解问题 This is an application design problem. If you are using a ORMapper tool that most of the tool itself handle this problem. If you are not using any OR mapping tool than you have to implement that level of inteligence at your Data access layer. DAL usually check which columns have been changed (may be a flag at each field) and generate update sql based on the changed field. Hoping this should given you insight of the problem

我的朋友,你还没有告诉你使用的是哪个控件(如GridView,ListView等) 好好看一下可编辑网格视图内的FindControl [ ^ ] 可能会有所帮助:) My Friend, you haven't told that which control you are using (like GridView, ListView etc.) well take a look at FindControl inside Editable GridView[^] might be helpful :)

更多推荐

检测要更新的列

本文发布于:2023-06-05 21:10:14,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/527645.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!