![]() |
load feature layer from sql server |
Post Reply
|
| Author | |
jerzypeng
Visitor
Joined: October 30 2011 Status: Offline Points: 2 |
Post Options
Thanks(0)
Quote Reply
Topic: load feature layer from sql serverPosted: 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; } |
|
![]() |
|
Post Reply
|
|
|
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |