www.skylinesoft.com Homepage
Forum Home Forum Home > SkylineGlobe Enterprise Products > TerraExplorer Pro and TerraExplorer Plus
  New Posts New Posts RSS Feed - load feature layer from sql server
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

load feature layer from sql server

 Post Reply Post Reply
Author
Message
jerzypeng View Drop Down
Visitor
Visitor


Joined: October 30 2011
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote jerzypeng Quote  Post ReplyReply Direct Link To This Post Topic: load feature layer from sql server
    Posted: October 30 2011 at 3:18pm
Hi, does anyone know how to load feature layer from sql server via programming code(not GUI)?
The information control of TerraExploer has the GUI loading options of sql server, and in the api, there is CreateLayer function, if the xmllayerbaseinfo is conducted, then it shoud be load via programming.
i finished the shape file loading, but failed to load from sql server layer(that would be a table including model position and mode filepath). 

Please help me to finish following function, any help would be greatly appreciated.
Thanks!

public static string GetCustomXmlSqlserverLayer(string server,string user,string pwd,string tbName,List<string>fields)
        {
            string xml = string.Empty;
            xml = "<PlugData>";
            xml += "<LayerName></LayerName>";
            xml += "<PlugType>??</PlugType>";
            xml += "<Server>"+server+"</Server>";
            xml += "<user>" + user + "</user>";
            xml += "<password>" + pwd + "</password>";
            xml += "<TableName>" + tbName + "</TableName>";
            xml += "<AttributesToLoad>";
            foreach (string s in fields)
                xml += s + ",";
            if (xml.Contains(','))
                xml = xml.Substring(0, xml.Length - 1);
            xml += "</AttributesToLoad></PlugData>";
            return xml;
        }
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.047 seconds.