如何在Delphi XE7中使用TFDTable(FireDAC)? [英] How to work on TFDTable(FireDAC) in Delphi XE7?

查看:80
本文介绍了如何在Delphi XE7中使用TFDTable(FireDAC)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么机构可以帮助我使用TFDTable.FireDac对我来说是全新的.我已在delphi 2010中将TTable用于内存数据库.因此,我想在xe7中使用TFDTable进行临时保留.

can some body provide help me to use TFDTable.FireDac is completely new for me. I have used TTable in delphi 2010 for memory database. So i would like to use TFDTable in xe7 for temporary hold.

推荐答案

如果您完全不熟悉FireDAC,则通常需要阅读FireDAC,并查看Delphi的最新版本附带的示例.

Well you need to read up on FireDAC generally if you are completely unfamiliar with it, and look at the examples that come with recent versions of Delphi.

但是,如果您只是想知道如何将数据从连接到数据库的FireDAC数据集复制到内存表中,则可以非常简单地进行操作,如下所示:

But if you just want to know how to copy data from a FireDAC dataset that's connected to a database to an in-memory table, you can do it very simply, like this:

procedure TForm1.btnCopyToMemTableClick(Sender: TObject);
begin
  FDMemTable1.Data := FDQuery1.Data;
  FDQuery1.Close;  //  don't need it open any more
end;

在这里,FDQuery1是一个TFDQuery,它与TQuery类似,因为它具有SQL TStrings属性,可让您指定要执行的SQL查询以检索数据.

Here, FDQuery1 is a TFDQuery, which is similar to a TQuery, in that it has a SQL TStrings property to allow you to specify what Sql query to execute to retrieve the data.

这篇关于如何在Delphi XE7中使用TFDTable(FireDAC)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆