table表与图层之间的Join
1.Join到SQL中的表
站在用户的角度思考问题,与客户深入沟通,找到陈仓网站设计与陈仓网站推广的解决方案,凭借多年的经验,让设计与互联网技术结合,创造个性化、用户体验好的作品,建站类型包括:做网站、网站制作、企业官网、英文网站、手机端网站、网站推广、空间域名、网站空间、企业邮箱。业务覆盖陈仓地区。
- IFeatureLayer pFeatureLayer = axMapControl1.Map.get_Layer(0) as IFeatureLayer;
- IFeatureClass pFeatureClass = pFeatureLayer.FeatureClass;
- IWorkspaceFactory pWsFact;
- IWorkspace pWorkspace;
- pWsFact = new OLEDBWorkspaceFactoryClass();
- IPropertySet pPropertySet=new PropertySetClass();
- pPropertySet.SetProperty("CONNECTSTRING", "Provider=SQLOLEDB;server=.;database=test;User Id=sa;Password=123");
- pWorkspace = pWsFact.Open(pPropertySet, 0);
- IFeatureWorkspace pFeatWS = (IFeatureWorkspace)pWorkspace;
- ITable pOleTable = pFeatWS.OpenTable(inTable);
- IMemoryRelationshipClassFactory pMemRelFact = new MemoryRelationshipClassFactoryClass();
- IRelationshipClass pRelClass = pMemRelFact.Open("", pFeatureClass, "村", (IObjectClass)pOleTable, "cunWei", "forward", "backward", esriRelCardinality.esriRelCardinalityOneToOne);
- IDisplayRelationshipClass pDispRC=pFeatureLayer as IDisplayRelationshipClass;
- pDispRC.DisplayRelationshipClass(pRelClass, esriJoinType.esriLeftOuterJoin);
新闻标题:table表与图层之间的Join
转载来于:http://ybzwz.com/article/ihssjd.html