| Interstage Shunsaku Data Manager Application Development Guide - Microsoft(R) Windows(R) 2000/ Microsoft(R) Windows Server(TM) 2003 - - UNIX - | 
			Contents
			Index
			![]()  
		 | 
	
| Part 1 The Basic for Developing Application | > Chapter 6 Direct Access Function | > 6.6 Updating Data by Direct Access Key | 
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.

Sample 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();  | 
(1) Set the Direct Access KeySet the direct access key at the ShunRecord object.
(2) Set the Data to be UpdatedSet the data to be updated at the ShunRecord object.
(3) Create a ShunKeyRequirement ObjectCreate a ShunKeyRequirement object.
(4) Set to the ShunKeyRequirement ObjectSet 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.
(5) Execute the UpdateSpecify 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
			![]()  
		 |