Saturday, May 05, 2012 9:22 PM
is it possible to override the default update query used by an EntityDataSource at runtime?
i have a need to exclude a column from update when it is not changing because the bound telerik RadGrid control does not handle binary data (in this case pictures) the same way as other columns' data types - meaning that the data is no longer available after selecting. since the binary data update value is null when it does not change, and my column constraint is Not Null, an update error is generated. even without the contraint it would null it out, something i do not want.
so, i can modify the update statement if possible. otherwise i have to create a mapped stored procedure to update the database. does ef5 still have an all or nothing policy on this matter in re crud? ie all crud operations have to be mapped to stored procedures if any is?
i am not sure that getting the original data would help, but does entitydatasource cache it if viewstate is enabled?
Monday, May 07, 2012 8:16 AMModerator
Please repost your question here: http://forums.asp.net/54.aspx/1?DataSource+Controls+SqlDataSource+ObjectDataSource+etc.
BTW, From the document in MSDN, You can submit updates to the data source from outside a data-bound control by adding, modifying, and deleting objects in an ObjectContext. For more information, see How to: Add, Modify, and Delete Objects (Entity Framework). After you call the SaveChanges method to commit the changes in the ObjectContext to the data source, call the DataBind method on the data-bound control to update the control with the latest data from the data source.
Have a nice day.
- Marked As Answer by Allen Li - AI3Microsoft Contingent Staff, Moderator Wednesday, June 06, 2012 4:17 AM