RefreshMode = Both does not work

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
Tatyana
Posts: 17
Joined: Mon 08 Sep 2008 14:01

RefreshMode = Both does not work

Post by Tatyana » Fri 08 May 2009 17:14

Situation:
Typed dataset. Master-Detail.

Master:
dataset1.table1 is master. SQL Text : select a.aa from a
In the Grid1 dataset1.table1 is shown.
Detail:
Detail dataset1.table2 is detail. SQL Text : select b.bb, b.bb as bb2, a.aa from a, b where a.aID = b.aID
dataset1.table2.RefreshMode = RefreshRowMode.Both;
dataset1.table2.RefreshingFields = "aa, bb";
In the Grid2 dataset1.table2 is shown. Grid2 has two columns:
- column 1 shows bb column.
- column 2 shows aa column
I also have control binded to bb2 column.
I do:
I add new record to dataset1.table2. Set bb2 column value and save (dataset1.table2.Update()).
I see in the grid that new record has been added, but both columns are empty.

Question: Why autorefresh does not work? Why fields values are not retrieveed from the server after an UPDATE statement execution.
________
HEADSHOP
Last edited by Tatyana on Thu 24 Feb 2011 22:45, edited 4 times in total.

Tatyana
Posts: 17
Joined: Mon 08 Sep 2008 14:01

more information

Post by Tatyana » Fri 08 May 2009 17:18

Grid is DevExpress.XtraGrid
I use ver 5.0.22
I tried in ver 5.20.29 - the same bug =(

DBMonitor shows only "insert" call. no select call.

only if I scroll in Master - I see Grid 2 Column Values

Please help, may be I miss some kind of property that should be set?
________
XL7
Last edited by Tatyana on Thu 24 Feb 2011 22:46, edited 2 times in total.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Wed 13 May 2009 11:54

Thank you for the bug report. I will post here when the problem is fixed.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Wed 13 May 2009 16:51

Sorry, this is not a bug. When you create Devart Typed DataSet, TableAdapter's insert and update commands are generated in our DataSet Wizard. So, it is not enough to set the RefreshMode and RefreshingFields properties if the update commands are generated already. Please use the following code:

Code: Select all

dataset1.table2.InsertCommand = null;
dataset1.table2.UpdateCommand = null;
dataset1.table2.RefreshMode = RefreshRowMode.Both;
dataset1.table2.RefreshingFields = "aa, bb";
The update commands will be regenerated automatically with the RETURNING clause, and the values will be retrieved from the server after an UPDATE statement execution.

Please notify us about the results.

Tatyana
Posts: 17
Joined: Mon 08 Sep 2008 14:01

Post by Tatyana » Sat 30 May 2009 10:06

Your suggestion does not work:


{System.InvalidOperationException: Dynamic SQL generation is not supported against multiple base tables.
at System.Data.Common.DbDataAdapter.UpdatingRowStatusErrors(RowUpdatingEventArgs rowUpdatedEvent, DataRow dataRow)
at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping)
at System.Data.Common.DbDataAdapter.UpdateFromDataTable(DataTable dataTable, DataTableMapping tableMapping)
at System.Data.Common.DbDataAdapter.Update(DataTable dataTable)
at Devart.Common.DbDataTable.Update()
at Devart.Data.Oracle.OracleDataTable.Update()
at Centric.CommonLib.DBBindingHandler.PostDataSource() in C:\src\PCM\Projects\Centric\MVV4all.NET\CommonLib\DBButtons.cs:line 185}
________
GRIEF OR LOSS ADVICE
Last edited by Tatyana on Thu 24 Feb 2011 22:46, edited 1 time in total.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Mon 01 Jun 2009 16:49

This works for one table only. If your select contains several tables, you can choose one table you are interested in by setting the UpdatingTable property to the name of that only table. Other tables from the select command will not be updated.

Tatyana
Posts: 17
Joined: Mon 08 Sep 2008 14:01

Post by Tatyana » Mon 15 Jun 2009 12:30

It is not comfortable :cry: and not usefull, besides Odac Delphi components handle it wihtout any problem.

Please recommend how can I update columns which belong to onother table, not the one which columns are being updated from UI.
________
Maine Dispensary
Last edited by Tatyana on Thu 24 Feb 2011 22:46, edited 1 time in total.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Thu 18 Jun 2009 14:11

We recommend you to create the update command manually. For example, OracleDataTable with the "select b.bb, b.bb as bb2, a.aa from a, b where a.aID = b.aID" select command should have the following update command:
UPDATE SCOTT.B SET BB = :BB WHERE (((:IsNull_BB = 1 AND BB IS NULL) OR (BB = :Original_BB))) RETURNING BB, BB INTO :BB, :BB2

Please note, :BB and :BB2 should have the InputOutput direction.

Tatyana
Posts: 17
Joined: Mon 08 Sep 2008 14:01

Post by Tatyana » Fri 07 Aug 2009 10:44

Shalex wrote:This works for one table only. If your select contains several tables, you can choose one table you are interested in by setting the UpdatingTable property to the name of that only table. Other tables from the select command will not be updated.
I didn't help:


dataset1.table2.InsertCommand = null;
dataset1.table2.UpdateCommand = null;
dataset1.table2.RefreshMode = RefreshRowMode.Both;
dataset1.table2.UpdatingTable = "b"; //update table b

// Using this:
dataset1.table2.RefreshingFields = "aa, bb";
// I get error ORA-00926: missing VALUES keyword
//dataset1.table2.InsertCommand is null

//Using this: asking for updating only column of the b table
dataset1.table2.RefreshingFields = "bb";
// I get error:
//ORA-06550: line 1, column 35:
//PL/SQL: ORA-00926: missing VALUES keyword
//ORA-06550: line 1, column 7:
//PL/SQL: SQL Statement ignored
//dataset1.table2.InsertCommand is null
________
Jaguar aj-v6 engine history
Last edited by Tatyana on Thu 24 Feb 2011 22:47, edited 1 time in total.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Wed 12 Aug 2009 11:08

We cannot reproduce the ORA-00926 error. Does command generation fail on calling the Update() method in your case? Have you tried the 5.25.39 version? Anyway, please try editing the insert/update commands manually if command generation fails or gives an incorrect statement.

Post Reply