//获取数据库的数据类型(ORACLE MDB GDB) public static string GetDescriptionOfWorkspace(IWorkspace pWorkspace) { if (pWorkspace == null) { return(""); } IWorkspaceFactory pWorkSpaceFac = pWorkspace.WorkspaceFactory; if (pWorkSpaceFac == null) { return(""); } string strDescrip = pWorkSpaceFac.get_WorkspaceDescription(false); return(strDescrip); }
//获取数据库的数据类型(ORACLE MDB GDB) public static string GetDescriptionOfWorkspace(IWorkspace pWorkspace) { string strLike = "%"; if (pWorkspace == null) { return(strLike = "%"); } IWorkspaceFactory pWorkSpaceFac = pWorkspace.WorkspaceFactory; if (pWorkSpaceFac == null) { return(strLike = "%"); } string strDescrip = pWorkSpaceFac.get_WorkspaceDescription(false); switch (strDescrip) { case "Personal Geodatabase": //mdb数据库 使用*作匹配符 strLike = "*"; break; case "File Geodatabase": //gdb数据库 使用%作匹配符 strLike = "%"; break; case "Spatial Database Connection": //sde(oracle数据库) 使用%作匹配符(sql server数据库,现在暂未考虑) strLike = "%"; break; default: strLike = "%"; break; } return(strLike); }