开发者

ASP.NET - FormView - Datasource update only some of the fields

I have a ASP.NET page that contains a formview and ObjectDataSource. On the page I only have 4 fields that are bound to fields in my datasource. My datasource contains 10 fields. When I call an update it is setting the 6 fields I am not binding to to null. The only way I can find it get around this is to add hidden fields for the 6 unbound fields and bind them to the datasource.

Is there anyway around this without using hidden fields? I would think that it should only update the fields you are binding to and ignore the others.

Any s开发者_如何学运维uggestions?

Thanks.


The solution is to just change by hand the Update Code on the datasource of your formview.

Just remove the fields that you do not won to update. Its a simple SQL command.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜