.NET compression of XML to store in SQL Server database

后端 未结 4 1302
北海茫月
北海茫月 2020-12-19 17:26

Currently our .NET application constructs XML data in memory that we persist to a SQL Server database. The XElement object is converted to a string using ToString() and then

4条回答
  •  生来不讨喜
    2020-12-19 18:04

    Besides possibly compressing the string itself (perhaps using LBushkin's Base64 method above), you probably want to start with making sure you kill all the whitespace. The default XElement.ToString() method saves the element with "indenting". You need to use the ToString(SaveOptions options) method (using SaveOptions.DisableFormatting) if you want to make sure you've just got the tags and data.

提交回复
热议问题