| Interstage Shunsaku Data Manager アプリケーション開発ガイド - Microsoft(R) Windows(R) 2000/ Microsoft(R) Windows Server(TM) 2003 - - UNIX共通 - |
目次
索引
![]()
|
| 第2部 APIでのアプリケーション開発 | > 第10章 .NET APIのアプリケーション開発 | > 10.3 .NET APIの使用方法 | > 10.3.3 データの更新 |
データを追加するには、Insertメソッドを使用します。
データを追加する場合の流れについて、以下の図に示します。

ShunService service = new ShunService();
service.Connect();
String data = "<document>"
+" <base>"
:
+" </base>"
+" <information>"
:
+" </information>"
+"</document>";
ShunRecordCollection recCol = new ShunRecordCollection(); (1)
ShunRecord record = new ShunRecord( data ); (2)
recCol.Add( record ); (3)
service.Insert( recCol ); (4)
service.Disconnect(); |
Dim service As New ShunService()
service.Connect()
Dim data As String = "<document>" _
&" <base>" _
:
&" </base>" _
&" <information>" _
:
&" </information>" _
&"</document>"
Dim recCol As New ShunRecordCollection() (1)
Dim record As New ShunRecord( data ) (2)
recCol.Add( record ) (3)
service.Insert( recCol ) (4)
service.Disconnect() |
ShunRecordCollectionオブジェクトを作成します。
追加したいXML文書をShunRecordオブジェクトに設定します。XML文書を設定するには、以下のメソッドを使用します。使用可能なメソッドについては以下の表を参照してください。
|
メソッド名またはプロパティ名 |
機能説明 |
|---|---|
|
ShunRecord(String data) |
XML文書をコンストラクタの引数に指定してShunRecordオブジェクトを生成します。 |
|
ShunRecord(Stream stream) |
XML文書をコンストラクタの引数に指定してShunRecordオブジェクトを生成します。 |
|
Dataプロパティ |
XML文書を指定します。 |
|
setData(Stream stream) |
XML文書を指定します。 |
ShunRecordオブジェクトを、ShunRecordCollectionオブジェクトに設定します。
ShunRecordオブジェクトを設定するには、以下のメソッドを使用します。使用可能なメソッドについては以下の表を参照してください。
|
メソッド名またはプロパティ名 |
機能説明 |
|---|---|
|
Add(ShunRecord record) |
ShunRecordをShunRecordCollection の末尾に追加します。 |
|
AddRange(ShunRecord[] records) |
ShunRecord配列の要素を ShunRecordCollectionの末尾にコピーします。 |
|
Insert(int index, ShunRecord record) |
ShunRecordCollection 内の指定したインデックス位置に、ShunRecord を挿入します。 |
|
Item[int index] |
指定したインデックス位置のShunRecordを置き換えます。 |
追加の実行はInsertメソッドを使用します。
目次
索引
![]()
|