Robert jenkin 2006-07-22 17:29:55
I have writen a c# program to load data from a sql table as xml and using
serialization populate classes with the data.
The problem, my question. It seams there is a data length limitation when
selecting sql as xml. My program selects 5 columns and crashes if I limit
the number of rows it works.
Does anyone have any idea as to a size limit with xml
Michael rys ms 2006-07-22 17:30:40
How do you get the XML back? If you are using SQL Server 2000, you will need
to use a specific API call to get the XML as a single stream back…
Robert jenkin 2006-07-22 17:31:41
the code is as follows
string sSQL = @”select * from sites FOR XML AUTO, ELEMENTS”;
oSystemCommand = new SqlCommand(sSQL, SqlConnSystem);
oDataReader = oSystemCommand.ExecuteReader();
sXML = “” + oDataReader.GetString(0).Trim() + ““;
//sXML = oDataReader.GetString(0).Trim();
StringReader osr = new StringReader(sXML) ;
xmlser = new XmlSerializer(typeof(data));
data oSites = (data)xmlser.Deserialize(osr);
bob jenkin (my first response was added as a new item, sorry)
Peter flynn 2006-07-22 17:32:06
XML itself has no defined size limits, either on markup or on
data content (except for a minor historical oddity in its SGML
compliance mode which is probably irrelevant here).
Your software may have other limits, however.
XML FAQ: http://xml.silmaril.ie/
Bertan ari msf 2006-07-22 17:34:05
Could you try getting xml by using ExecuteXmlReader? The following page has
an snippet code on how to do it:
This posting is provided “AS IS” with no warranties, and confers no rights.