随笔 - 2146  文章 - 97 评论 - 11767 trackbacks - 253




uses XMLDoc;

procedure TForm1.FormCreate(Sender: TObject);
begin
  with ClientDataSet1 do begin
    FieldDefs.Add('Text', ftString, 12);
    FieldDefs.Add('Num', ftInteger);
    CreateDataSet;
    AppendRecord(['ABC', 123]);
  end;
  Memo1.Text := FormatXMLData(ClientDataSet1.XMLData);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  ClientDataSet1.SetOptionalParam('ParamX', 12345);
  Memo1.Text := FormatXMLData(ClientDataSet1.XMLData);
  ShowMessage(ClientDataSet1.GetOptionalParam('ParamX'));
end;

posted on 2010-02-04 10:57  万一  阅读(...)  评论(...编辑  收藏