I'm wondering if it's possible to generate update and select commands with a PgSqlDataTable class? I've filled connection, columns, contraints, primary key, selectcommand, refreshingfields, refreshmode, updatingfields, updatingkeyfields and updatingtable.
Is there a member of PgSqlDataTable which generates the insertcommand and updatecommand for me? It would be nice to only update fields which have been modified before.
How to generate update command with PgSqlDataTable?
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44
You can generate commands in design time. Drag PgSqlDataTable from toolbox on your form, double click it, change Type from Text to TableDirect, and select the required table on the 'Select Text' tab. Will be generated isert command. Also you can generate update, insert and delete command on 'Command Generator' tab by pushing 'Generate Commansds' button. For more details please refer to http://www.devart.com/dotconnect/postgr ... ditor.htmlovertime wrote:I'm wondering if it's possible to generate update and select commands with a PgSqlDataTable class?
When you modify some field in a row, then RowState will be changed to Modified for this row. When you call PgSqlDataTable.Update() each modified row will be updated and you do not have to specify UpdateCommand for this.overtime wrote:Is there a member of PgSqlDataTable which generates the insertcommand and updatecommand for me? It would be nice to only update fields which have been modified before.
Ok, now I get what it's supposed to do. I actually want to build an update command, which only contains the changed field's definition. The point of doing this is that since postgres 9 it is possible to set column-level privileges, but if I use an update query which sets every field of the table, the whole thing becomes pointless.
Let's say there are 3 columns:
Is there any practice to circumvent this?
Thanks!
Let's say there are 3 columns:
- Column A
Column B
Column C
Is there any practice to circumvent this?
Thanks!
-
- Devart Team
- Posts: 2420
- Joined: Wed 02 Nov 2011 09:44