In einer Managed Class können mehrere SQL-APIs, Funktionen und Attribute gesammelt werden. Nach Zuordnung der Managed Class zu einer individuellen Maske stehen alle diese SQL-APIs, Funktionen und Attribute zur Verfügung.
Implementieren Sie ein einfaches Logging-System. Die Logs werden in der Tabelle VTAB_SimpleLog gespeichert. Struktur:
DB-Name | Name | Typ |
---|---|---|
VCOL_DateTime | Date and Time | Datum und Zeit |
VCOL_Type | Type | Zeichenfolge(50) |
VCOL_Location | Location | Zeichenfolge(100) |
VCOL_Message | Message | Zeichenfolge(unbegrenzt, mehrzeilig) |
VCOL_Tags | Tags | Zeichenfolge(unbegrenzt, mehrzeilig) |
insert into VTAB_SimpleLog (VTAB_SimpleLog_MDT_ID, VCOL_DateTime, VCOL_Type, VCOL_Location, VCOL_Message, VCOL_Tags) values (@_MdtId, getdate(), left(@typ, 50), left(@location, 100), @message, @tags)
Name | Typ |
---|---|
location | string |
message | string |
tags | string[] |
string mlTags = (tags != null ? string.Join("\r\n", tags) : ""); this.SqlInsert("Error", location, message, mlTags);
string mlTags = (tags != null ? string.Join("\r\n", tags) : ""); this.SqlInsert("Info", location, message, mlTags);Kompilieren...
SimpleLog.InsertInfo("MainForm: After form init", "Hi, just a Info", new string[] { "simplelog", "managedclass", "csharp", "forthefirsttime" } );