Downloads Articles Order Sign In
Welcome to Official Berg Software web site. Twelve years with you! All other websites providing Berg Software source code and content are illegal. We will not support users who use services, or buy products from illegal Berg Software websites. more...
  Home  
  News Archive  
  Components  
  Applications  
  Downloads  
  Order  
  Support  
  About  
 
  Components
  GridView
  DBGridView
  PropertiesView
  SheetView
  Comp. Collection
 
  Applications
  Berg Player
  SMS Mara Gateway
  Domain Binocular
 
 
  Support
  Contact Us
  Support forums
  Articles
 
 
 
LOOKUP COLUMN TUTORIAL
Home Articles DBGridView

With using Lookup Column we can combine Fields of 2 Tables or Queries to get result similiar when using SQL Join commands. Sometime we need to display some Field from first table with using Field from second Table.

In next example we have 2 tables: Articles and Article_types

Articles
id name article_type_id
1 Keyboard 1
2 Mouse 1
3 WindowsXP 2
4 Delphi 2

and second one:

Article_types
id name
1 Hardware
2 Software

to get next result:

id name article_type_id
1 Keyboard Hardware
2 Mouse Hardware
3 WindowsXP Software
4 Delphi Software

 

To made this, we need to have 2 TTable (TADOTable, TIBTable, TZTable...) and 2 TDataSource components on placed form.

KeyFieldName - Field from second Table

ListDataSource - Set to second DataSource

ListFieldName - Set to displaying Field from second Table. In our case is name.

 

 


 
Copyright © BergSoftware 1996 - 2009. All rights reserved.Contact Us.