您好,按照您给的代码测试,并未出现您说的问题,代码如下:
workspace = new Workspace();
string path = @"C:\Users\Administrator\Desktop\zz.smwu";
WorkspaceConnectionInfo info = new WorkspaceConnectionInfo(path);
workspace.Open(info);
DatasourceConnectionInfo dinfo = new DatasourceConnectionInfo();
// 设置数据源位置为内存中,类型为UDB
dinfo.Server = ":memory:";
dinfo.EngineType = EngineType.UDB;
Datasource m_datasource = workspace.Datasources.Create(dinfo);
DatasetVectorInfo l_DatasourceConnectionInfo = new DatasetVectorInfo();
l_DatasourceConnectionInfo.IsFileCache = false;
l_DatasourceConnectionInfo.Name = "GradeGrid";
l_DatasourceConnectionInfo.EncodeType = EncodeType.Int32;
l_DatasourceConnectionInfo.Type = DatasetType.Region;
Dataset l_datasetMemory = m_datasource.Datasets.Create(l_DatasourceConnectionInfo);