By Greg McGuffey - 12/6/2007
I find myself occasionally needing to update a single record within a BO, usually after messing with data via a sproc. Is there any way to update just one record (row) in the BO?
|
By StrataFrame Team - 12/7/2007
Well, if it's the only DataRow in the BO that is not Unchanged (modified), then it will be the only row that is saved. Otherwise, you would need to create a new business object, filter the current one down to that record, use MergeDataFrom to copy over the record, and save the new business object with just that one record in it.
|
By Greg McGuffey - 12/7/2007
Oops, you misunderstand. How do I refresh that single data row with data from the database?
|
By StrataFrame Team - 12/10/2007
Aha, that makes more sense You can use the AppendDataTable method and pass the query that will only retrieve that one record (we don't have an AppendByPrimaryKey). The other argument for the AppendDataTable() method, besides the DbCommand, is an enum that specifies whether to overwite duplicate records or keep duplicate records; you want to overwrite the record.
|
By Robin J Giltner - 12/10/2007
Does the AppendDataTable fire the CurrentDataTableRefilled Event ?Thanks, Robin Giltner
|
By Trent L. Taylor - 12/11/2007
Yes. When tables are merged it goes through the ChangeCurrentDataTable method which ultimately raises the CurrentDataTableRefilled event.
|