Set, Get Active record value

Set, Get Active record value

Postby zguven » Tue 23 Sep 2008 12:33

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.
zguven
 
Posts: 21
Joined: Mon 05 May 2008 19:39

Postby zguven » Thu 25 Sep 2008 05:17

Where is the support?
zguven
 
Posts: 21
Joined: Mon 05 May 2008 19:39

Postby Shalex » Thu 25 Sep 2008 09:37

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.
Shalex
Devart Team
 
Posts: 7391
Joined: Thu 14 Aug 2008 12:44

Postby zguven » Thu 25 Sep 2008 10:17

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.
zguven
 
Posts: 21
Joined: Mon 05 May 2008 19:39

Postby Shalex » Thu 25 Sep 2008 13:51

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/ss7fbaez(VS.80).aspx

OnBeforePost and OnAfterPost events' equivalents are RowUpdating and RowUpdated events of OracleDataTable component.
Shalex
Devart Team
 
Posts: 7391
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle