Interstage Shunsaku Data Manager Application Development Guide - Microsoft(R) Windows(R) 2000/ Microsoft(R) Windows Server(TM) 2003 - - UNIX -
Contents Index PreviousNext

Part 1 The Basic for Developing Application> Chapter 6 Direct Access Function> 6.6 Updating Data by Direct Access Key

6.6.2 For .NET API

The UpdateByKey method is used in the direct update for .NET API.

The following figure shows a flow of the direct update for .NET API.

[Figure 6-13 A flow of the direct update]

mark1Sample Code

ShunService service = new ShunService();
service.Connect();

ShunRecord record1 = new ShunRecord();
ShunRecord record2 = new ShunRecord();
ShunRecord record3 = new ShunRecord();
record1.Key = "20061101,00000001";                                       (1)
record2.Key = "20061101,00000002";                                       (1)
record3.Key = "20061101,00000003";                                       (1)
record1.Data = updateData1;                                              (2)
record2.Data = updateData2;                                              (2)
record3.Data = updateData3;                                              (2)

ShunKeyRequirement keyReq = new ShunKeyRequirement();                    (3)
keyReq.KeyName = "key1";                                                 (4)
keyReq.SearchType = ShunKeySearchType.CompleteMatch;                     (4)
keyReq.Records.Add( record1 );                                           (4)
keyReq.Records.Add( record2 );                                           (4)
keyReq.Records.Add( record3 );                                           (4)

service.UpdateByKey( keyReq );                                           (5)

service.Disconnect();

mark2(1) Set the Direct Access Key

Set the direct access key at the ShunRecord object.

mark2(2) Set the Data to be Updated

Set the data to be updated at the ShunRecord object.

mark2(3) Create a ShunKeyRequirement Object

Create a ShunKeyRequirement object.

mark2(4) Set to the ShunKeyRequirement Object

Set the direct access key name and the ShunRecord object to the ShunKeyRequirement object.

Specifying multiple ShunRecord objects with the add method to update multiple XML documents at a time.

mark2(5) Execute the Update

Specify the ShunKeyRequirement object to the UpdateByKey method and execute the update.

Refer to the following sections for the sample programs of the direct access.
For C# .NET: G.3.4 Update Data Using Direct Access Key
For VB .NET: H.3.4 Update Data Using Direct Access Key
For C++ .NET: I.3.4 Update Data Using Direct Access Key

Contents Index PreviousNext

All Rights Reserved, Copyright(C) FUJITSU LIMITED 2006