举例:创建JZD表
Dim tab_name As String = "JZD"
'使用默认值为GlobalID字段:GlobalID
Dim globalIDFieldDescription As ArcGIS.Core.Data.DDL.FieldDescription = ArcGIS.Core.Data.DDL.FieldDescription.CreateGlobalIDField()
'使用默认值为对象ID字段:ObjectID
Dim objectIDFieldDescription As ArcGIS.Core.Data.DDL.FieldDescription = ArcGIS.Core.Data.DDL.FieldDescription.CreateObjectIDField()
'为Date(日期型)字段字段 字段名:InspectionDate
Dim inspectionDateFieldDescription As ArcGIS.Core.Data.DDL.FieldDescription = New ArcGIS.Core.Data.DDL.FieldDescription("InspectionDate", FieldType.Date)
inspectionDateFieldDescription.AliasName = "Inspection Date"
'字符串字段创建 FieldDescription
Dim inspectionNotesFieldDescription As ArcGIS.Core.Data.DDL.FieldDescription = ArcGIS.Core.Data.DDL.FieldDescription.CreateStringField("InspectionNotes", 512)
inspectionNotesFieldDescription.AliasName = "Inspection Notes"
'将我们所有的字段描述汇编成一个列表
Dim fieldDescriptions As List(Of ArcGIS.Core.Data.DDL.FieldDescription) = New List(Of ArcGIS.Core.Data.DDL.FieldDescription) From {globalIDFieldDescription, objectIDFieldDescription, inspectionDateFieldDescription, inspectionNotesFieldDescription}
'创建一个表描述对象来描述要创建的表tab_name
Dim tableDescription As TableDescription = New TableDescription(tab_name, fieldDescriptions)
'创建架构构建器对象
Dim pgdbPath As String = Project.Current.DefaultGeodatabasePath
Await QueuedTask.Run(Sub()
Dim Geodatabase As Geodatabase = New Geodatabase(New FileGeodatabaseConnectionPath(New Uri(pgdbPath)))
Dim schemaBuilder As SchemaBuilder = New SchemaBuilder(Geodatabase)
'将Polecheck的创建添加到我们的DDL任务列表中
schemaBuilder.Create(tableDescription)
Dim success As Boolean = schemaBuilder.Build()
If success = False Then
Dim errorMessages As IReadOnlyList(Of String) = schemaBuilder.ErrorMessages
End If
End Sub)