检测要更新的列 [英] detecting column to be updated

查看:51
本文介绍了检测要更新的列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我有这个问题....

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



问候并感谢....

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 :)


这篇关于检测要更新的列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆