zoukankan
html css js c++ java
TClientDataSet的操作
记性不好了,唉,这里写个被忘
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Grids, DBGrids, DB, DBClient, StdCtrls;
type
TForm1
=
class
(TForm)
Button1: TButton;
Button2: TButton;
ClientDataSet1: TClientDataSet;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R
*
.dfm}
procedure TForm1.Button2Click(Sender: TObject);
begin
ClientDataSet1.LoadFromFile(
'
E:\TEMP.XML
'
);
end;
procedure TForm1.Button1Click(Sender: TObject);
var tempClientDataSet : TClientDataSet;
begin
tempClientDataSet :
=
TClientDataSet.Create(self);
try
with tempClientDataSet
do
begin
with FieldDefs.AddFieldDef
do
begin
DataType :
=
ftInteger;
Name :
=
'
Field1
'
;
end;
with FieldDefs.AddFieldDef
do
begin
DataType :
=
ftdatetime;
Name :
=
'
Field2
'
;
end;
createDataSet;
appendRecord([
3
,now]);
appendRecord([
1
,now]);
appendRecord([
2
,now]);
tempClientDataSet.AddIndex(
'
T1
'
,
'
Field1
'
, []);
tempClientDataSet.IndexName :
=
'
T1
'
;
first;
while
not EOF
do
begin
showmessage(intToStr(FieldByName(
'
Field1
'
).AsInteger)
+
formatdatetime(
'
yyyymmdd HH:NN:DD
'
,FieldByName(
'
Field2
'
).AsDateTime ));
next;
end;
end;
tempClientDataSet.SaveToFile(
'
E:\TEMP.XML
'
);
finally
tempClientDataSet.Free;
end;
end;
end.
查看全文
相关阅读:
Hadoop学习笔记—12.MapReduce中的常见算法
Hadoop学习笔记—11.MapReduce中的排序和分组
Hadoop学习笔记—10.Shuffle过程那点事儿
Hadoop学习笔记—9.Partitioner与自定义Partitioner
Hadoop学习笔记—8.Combiner与自定义Combiner
Hadoop学习笔记—7.计数器与自定义计数器
Hadoop学习笔记—6.Hadoop Eclipse插件的使用
Hadoop学习笔记—5.自定义类型处理手机上网日志
Hadoop学习笔记—4.初识MapReduce
Hadoop学习笔记—3.Hadoop RPC机制的使用
原文地址:https://www.cnblogs.com/enli/p/642359.html
最新文章
jaeger使用yugabyte作为后端存储的尝试以及几个问题
openjdk k8s port-forward 连接容器jmx服务
scylladb docker-compose 用户密码认证配置
jaeger 使用scylladb作为后端存储
zeebe 0.20.0 发布生产可用了!
手工部署yugabyte的几点说明
yugabyte docker-compose 运行试用
Why We Changed YugaByte DB Licensing to 100% Open Source
什么是项目群和项目群管理?
项目群的交付能力和经验学习
热门文章
OAuth2.0 原理流程及其单点登录和权限控制
理解OAuth 2.0
一张图搞定OAuth2.0
研发成本计算方法
WebApp分析建模的工具
深入理解Fabric环境搭建的详细过程
一个程序从源代码到可执行程序的过程
产品经理业务流程图的绘制流程分享
Hadoop学习笔记—14.ZooKeeper环境搭建
Hadoop学习笔记—13.分布式集群中节点的动态添加与下架
Copyright © 2011-2022 走看看