Update specific columns

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
wjm4
Posts: 72
Joined: Mon 12 Feb 2007 21:31

Update specific columns

Post by wjm4 » Mon 07 Mar 2016 17:53

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.

azyk
Devart Team
Posts: 1119
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Update specific columns

Post by azyk » Thu 10 Mar 2016 14:12

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.

Post Reply