Difference between revisions of "TDataSource"
From Lazarus wiki
Jump to navigationJump to searchm |
|||
(2 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
+ | {{TDataSource}} | ||
+ | |||
'''TDataSource''' [[image:tdatasource.png]] is a component that mediates communication between a <tt>[[TDataSet]]</tt> based component that represents the database contents and Data Controls like <tt>[[TDBGrid]]</tt>. | '''TDataSource''' [[image:tdatasource.png]] is a component that mediates communication between a <tt>[[TDataSet]]</tt> based component that represents the database contents and Data Controls like <tt>[[TDBGrid]]</tt>. | ||
Line 8: | Line 10: | ||
DBGrid1.DataSource := '''DataSource1'''; | DBGrid1.DataSource := '''DataSource1'''; | ||
− | == | + | == See also == |
− | * [[doc:fcl/db/tdatasource.html|TDataSource]] | + | * [[doc:fcl/db/tdatasource.html|TDataSource doc]] |
+ | * [[TSQLTransaction]] | ||
+ | * [[TSQLQuery]] | ||
{{LCL Components}} | {{LCL Components}} | ||
− | |||
− |
Latest revision as of 07:57, 14 June 2017
│
English (en) │
français (fr) │
日本語 (ja) │
русский (ru) │
TDataSource is a component that mediates communication between a TDataSet based component that represents the database contents and Data Controls like TDBGrid.
Typically, a TDataSource contains a field 'DataSet' that connects to a TSQLQuery or other TDataSet descendant. The DataSource should connect to the 'DataSource' field of a TDBGrid or other Data Control component.
SQLTransaction1.Database := SQLConnection1; SQLQuery1.Transaction := SQLTransaction1; DataSource1.DataSet := SQLQuery1; DBGrid1.DataSource := DataSource1;
See also