//CREATE THE TABLE IN AN IN MEMORY WORKSPACE IObjectClassDescription ocDescription = new ObjectClassDescriptionClass(); Type factoryType = Type.GetTypeFromProgID( "esriDataSourcesGDB.InMemoryWorkspaceFactory"); IWorkspaceFactory workspaceFactory = (IWorkspaceFactory)Activator.CreateInstance (factoryType); IWorkspaceName workspaceName = workspaceFactory.Create("", "in_memory", null, 0); IName name = (IName)workspaceName; IFeatureWorkspace fws = (IFeatureWorkspace)name.Open(); string tableName = "tempTable"; ITable table = fws.CreateTable(tableName, fields, ocDescription.ClassExtensionCLSID, null, "");
pRow.Value(pRow.Fields.FindField("PipeFID")) = "myvalue"
The workspace is not connected.
Private Sub createDataTable() 'This function creates a table in memory to store data Dim pFields As IFields Dim pFieldsEdit As IFieldsEdit Dim pField As IField Dim pFieldEdit As IFieldEdit Set pFields = New Fields Set pFieldsEdit = pFields pFieldsEdit.FieldCount = 4 Set pField = New Field Set pFieldEdit = pField With pFieldEdit .Length = 10 .Name = "OID" .Type = esriFieldTypeOID .IsNullable = False End With Set pFieldsEdit.Field(0) = pField Set pField = New Field Set pFieldEdit = pField With pFieldEdit .Length = 20 .Name = "PipeFID" .Type = esriFieldTypeString End With Set pFieldsEdit.Field(1) = pField Set pField = New Field Set pFieldEdit = pField With pFieldEdit .Length = 10 .Name = "ParcelsWI" .Type = esriFieldTypeInteger End With Set pFieldsEdit.Field(2) = pField Set pField = New Field Set pFieldEdit = pField With pFieldEdit .Length = 10 .Name = "ParcelsWIB" .Type = esriFieldTypeInteger End With Set pFieldsEdit.Field(3) = pField 'Create the table using the created fields Dim pRecordSet As IRecordSet Set pRecordSet = New RecordSet Dim pRSInit As IRecordSetInit Set pRSInit = pRecordSet pRSInit.CreateTable pFields Set FinalTable = pRecordSet.table End Sub
Dim pRow As IRow Set pRow = FinalTable.CreateRow pRow.Value(pRow.Fields.FindField("PipeFID")) = "myvalue" pRow.Value(pRow.Fields.FindField("ParcelsWI")) = 5 pRow.Value(pRow.Fields.FindField("ParcelsWIB")) = 2 pRow.Store
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.