CreateDataset() public method

在指定的数据源中,根据指定的数据集信息创建一个新的数据集。
参数 datasourceName、datasetName 为空时抛出异常。 服务端处理错误时抛出异常。
public CreateDataset ( string datasourceName, string datasetName, DatasetType datasetType ) : bool
datasourceName string 数据源名称,必选参数。
datasetName string 数据集名称,必选参数。
datasetType DatasetType 数据集类型。目前支持六种枚举值:POINT、LINE、REGION、TEXT、CAD、TABULAR。
return bool
Exemplo n.º 1
0
        public void DeleteField()
        {
            Data data = new Data("http://" + ip + ":8090/iserver/services/data-world/rest");
            bool createDatasetResult = data.CreateDataset("World", "testUpdate1", DatasetType.LINE);

            bool createFieldResult = data.CreateField("World", "testUpdate1", new FieldInfo() { Caption = "name", Name = "name", Type = FieldType.CHAR });
            bool deleteFieldResult = data.DeleteField("World", "testUpdate1", "name");
            data.DeleteDataset("World", "testUpdate1");

            Assert.IsTrue(deleteFieldResult);
        }
Exemplo n.º 2
0
 public void UpdateField()
 {
     Data data = new Data("http://" + ip + ":8090/iserver/services/data-world/rest");
     try
     {
         data.DeleteDataset("World", "testUpdate2");
     }
     catch { }
     bool createDatasetResult = data.CreateDataset("World", "testUpdate2", DatasetType.LINE);
     bool createFieldResult = data.CreateField("World", "testUpdate2", new FieldInfo() { Caption = "name", Name = "name", Type = FieldType.CHAR });
     bool upateFieldResult = data.UpdateField("World", "testUpdate2", "name", new FieldInfo() { Caption = "Name1" });
     FieldInfo filedInfo = data.GetFieldInfo("World", "testUpdate2", "name");
     Assert.IsTrue(filedInfo.Name == "name");
     Assert.IsTrue(filedInfo.Caption == "Name1");
 }
Exemplo n.º 3
0
 public void CreateDatasetTest()
 {
     Data data = new Data("http://" + ip + ":8090/iserver/services/data-world/rest");
     DatasetInfo datasetInfo = new DatasetInfo();
     datasetInfo.Name = "World4";
     datasetInfo.Type = DatasetType.POINT;
     bool result = data.CreateDataset("World", datasetInfo.Name, datasetInfo.Type);
     Assert.IsTrue(result);
     bool deleteResult = data.DeleteDataset("World", "World4");
     Assert.IsTrue(deleteResult);
 }