在db中更新asp.net中的字段 [英] updating fields from asp.net in db
本文介绍了在db中更新asp.net中的字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
你必须将所有6个旧值传递给下一页
并绑定所有6个字段下拉列表文本框,而不是全部更新。
从问题中,您似乎对页面上的编辑功能感到困惑。通常,编辑页面应填充现有值。因此,除非已被用户删除,否则不会将非更改字段作为NULL插入到数据库中。
i am stuck in scenario, i have display record, if i want to edit then i click edit and it goes into edit mode, passing UserID to another page, EDIT page shows Textboxes, dropdowns to be edited, lets suppose i want to edit 3 fields out of 6 then how to keep old values for which i am not inserting or selecting anything because if i don't select/put any value then it will put null into that column in DB, so how to prevent and update only desired fields ?
解决方案
You have to pass all the 6 old values to next page
and bind all 6 field dropdownns text box , than updated all .
From the Question , it seems that you are bit confused on the Edit functionality on the Page. Usually , Edit Page should be Populated with the Existing Value . So there is no question of inserting Non Changed fields as NULL into the DB unless its been removed by the User.
这篇关于在db中更新asp.net中的字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文