sql server - C# SqlGeometry DataTable.WriteXml -
i have table in sql server column of type sqlgeometry
. loading datatable
, i'm executing datatable.writexml
. unfortunately, data column of type sqlgeometry
not written out.
datatable dt = new datatable(); string tabela = string.empty; tabela = "x.yz"; string sqlconstring = @"server=xxx.xxx.xxx.xxx\sqlexpress2012;database=xxx;user id=xx;password =xx; "; string sqlquery = string.format("select * {0}",tabela); using (sqlconnection sqlcon = new sqlconnection(sqlconstring)) { sqlcommand sqlcmd = new sqlcommand(sqlquery, sqlcon); try { sqlcon.open(); sqldatareader dr = sqlcmd.executereader(); dt.load(dr); } catch (exception e) { console.writeline(e.message); } } dt.tablename = "123"; dt.writexml(@"j:\tmp\3.xml");
instead of set of data only:
<?xml version="1.0" standalone="yes"?> <documentelement> <_x0031_23> <featid>5662</featid> (...) <geom xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"> <stsrid>2180</stsrid> </geom> </_x0031_23> <_x0031_23> <featid>5663</featid> (...)
how saved geometric data?
Comments
Post a Comment