Page 1 of 1

Set, Get Active record value

Posted: Tue 23 Sep 2008 12:33
by zguven
I use OracleDateTable and DataLink.

1.How to set/get selected row field values with datalink?
2.How to get row status (Insert, Update....) with datalink?


I am delphi programmer.
I need equivalent C# code.

Code: Select all

 If MyQuery.State=dsInsert then 
     MyQuery.FieldByName("ID").AsInteger:=1;

Code: Select all

  MyQuery.Insert;

Code: Select all

  MyQuery.Edit;

Code: Select all

  MyQuery.Post;

Code: Select all

  MyQuery.Cancel;
Thanks.

Posted: Thu 25 Sep 2008 05:17
by zguven
Where is the support?

Posted: Thu 25 Sep 2008 09:37
by Shalex

Code: Select all

dataLink1.AddNew();
DbDataRowView curRow = (DbDataRowView)dataLink1.Current;
curRow.BeginEdit();
if(curRow.Row.RowState == DataRowState.Detached) //Here you get the RowState of the row at current 
                                                                               //DataLink Position
    curRow.Row["deptno"] = 60; 
curRow.Row["dname"] = "MyDept"; //Here you modify values
curRow.EndEdit();
Please give us more information on the definition of MyQuery variable.

Posted: Thu 25 Sep 2008 10:17
by zguven
I want to use your "InterForm" tech. with DataLink. I have Many Forms and Master/Detail.

Your TOraQuery component very useful in delphi.
MyQuery defined as TOraQuery.

And what about OnBeforePost, OnAfterPost events.

Thanks.

Posted: Thu 25 Sep 2008 13:51
by Shalex
Our .NET components inherit the Microsoft's ADO.NET architecture, that's why we are not able to provide you the full analogue of the aforementioned events and properties.

You can refer to MSDN for more information:

http://msdn.microsoft.com/en-us/library ... S.80).aspx

OnBeforePost and OnAfterPost events' equivalents are RowUpdating and RowUpdated events of OracleDataTable component.