Page 1 of 1

Update specific columns

Posted: Mon 07 Mar 2016 17:53
by wjm4
I have a dataset that returns regular and computed columns from SQL Server. When I edit this data in a grid, I get an error returned that it can't update a computed column. However, that is not the column I am trying to update in the grid. I am updating a regular column. Is there a way to exclude the computed columns from the update? I have tried to create my own Update Statement but receive the same error.

Re: Update specific columns

Posted: Thu 10 Mar 2016 14:12
by azyk
In order to allow editing of computed columns in the grid, before opening the dataset, set the TField.ReadOnly property of fields with computed columns to False.

UniDAC doesn't include computed columns to the automatically generated UPDATE query if such are present in the SELECT query. Therefore you can let UniDAC decide whether to generate an UPDATE query.