skip to content »

Updating objectdatasource

Therefore, either remove the property altogether from the declarative syntax or, from the Properties window, set the value to the default, ., which means the data source control will overwrite any changes made to a data row between the time the data source control first read data from the row and the time that the row is updated.

This, unfortunately, will still result in the same problem discussed above. Please build a function to make sure that only valid columns are specified in the sort expression to avoid a SQL Injection attack. Just one a glitch when it comes to fetching grid with sorted columns.When i remove Data Source ID="Object Data Source1" and Datakeys ="id" and place in in the code-behind file, you can see the data, you can edit it, but it DON'T UPDATE!!!!!!!!! What you could probably do in your case is create the data source in Init, add it to teh Page/.Controls collection, and then set the Data Source ID for the Form View to be the ID of the data source.I bring it up now, however, because our BLL's methods do not expect the original values and therefore it's important that we remove this property.

Leaving the Old Values Parameter Format String property set to anything other than the default () will cause an error when a data Web control attempts to invoke the Object Data Source's Update() or Delete() methods because the Object Data Source will attempt to pass in both the Update Parameters or Delete Parameters specified as well as original value parameters.

For example, a sort expression that identifies the Last Name and First Name columns as the columns to use for sorting would be "Last Name, First Name" for an ascending sort and "Last Name, First Name DESC" for a descending sort. However, you might be working with a business object method that takes one or more parameters typed as a complex or user-defined type.

To work with complex or user-defined parameter types, you can use the property.

Parameters that get values from a specific object, such as a control, session variable, or the user profile, require you to set additional properties.

For example, a business object method, you can include parameters for sorting and paging.

The matching values indicate that the data has not changed since the time it was read. It seems that if, as it is by default, the Conflict Detection Property is set to Overwrite Changes, no additional *original_* parameters should be added to the Update Method!