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

Part 2 Developing Applications by APIs> Chapter 10 Developing .NET Applications> 10.3 How to Use .NET APIs> 10.3.3 Updating Data

10.3.3.2 Deleting Data by Specifying Record IDs

Use the Delete method to delete data.

The .NET APIs use record IDs to delete data. The record IDs of the data to be deleted have to be obtained before deleting the data.

The following diagram shows the process for deleting data by specifying a record ID.

[Figure 10-14 Flow of the Process for Deleting Data by Specifying a Record ID]

mark1Sample Code for C# .NET

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

ShunRecordCollection recCol = new ShunRecordCollection();                        (1)
recCol.Add( record );                                                            (2)
service.Delete( recCol );                                                        (3)

service.Disconnect();

mark1Sample Code for VB .NET

Dim service As New ShunService()
service.Connect()

Dim recCol As New ShunRecordCollection()                                         (1)
recCol.Add( record )                                                             (2)
service.Delete( recCol )                                                         (3)

service.Disconnect()

mark2(1) Create a ShunRecordCollection Object

Create a ShunRecordCollection object.

mark2(2) Set a ShunRecord Object

Set the ShunRecord object to be deleted at the ShunRecordCollection object.

Use the following methods to set the ShunRecord object. Refer to the table below for the methods that can be used to delete XML documents.

[Table 10-23 List of Methods for Setting ShunRecord Object]

Method or property

Function

Add(ShunRecord record)

Adds the ShunRecord to the end of ShunRecordCollection.

AddRange(ShunRecord[] records)

Copies the element of ShunRecord array to the end of ShunRecordCollection.

Insert(int index, ShunRecord record)

Inserts the ShunRecord at the index position specified in the ShunRecordCollection.

Item[int index]

Replaces the ShunRecord that the index position is specified.
This property will be the indexer of ShunRecordCollection class for C# .NET.

mark2(3) Delete the Data

Execute the delete process using the Delete method.


Contents Index PreviousNext

All Rights Reserved, Copyright(C) FUJITSU LIMITED 2006