eBiss 3

Hilfe & Dokumentation

User Tools

Site Tools


Sidebar

en:howtos:dbadapter:create_structure

A simple class structure

The following is an example of a Simple Class Structure for reading row from table:

  CREATE TABLE[dbo].[DbAdapterTest]
  (
     [Id][INT] NOT NULL,
     [LastName] [VARCHAR] (50) NOT NULL,
     [FirstName] [VARCHAR] (50) NOT NULL
  ) 

The best way to create the structure is to use Type libraries, create a type using “database adapter object” and then define the structure: In the example 'Item' is supposed to take the data from the table 'DbAdapterTest'.

  • the attribute MapTrigger must be defined and
  • the public name with DbAdapterTestg must be specified.

If the field name differs from the column name of the table, then the public name must also be assigned here. In the example here the field 'Name' has the public name 'LastName'. The template for the type can be found under

  • StandardTemplates\DBAdapter\eBissTypeLib\TypeLibraryeBiss_TypeLib_DbAdapter.xml

As C# code:

 public class DbAdapterSample : IDbMapObjectRoot
    {
        [MapExternalName("DbAdapterTest"), MapTrigger]
        public List<DbAdapterSampleItems> Items;
 
    }
 
    public class DbAdapterSampleItems : IMapObjectItem
    {
        public int Id;
 
        [MapExternalName("LastName")]
        public string Name;
 
        public string FirstName;
    }
 
 
en/howtos/dbadapter/create_structure.txt · Last modified: 2024/02/20 08:15 by 127.0.0.1