I’m trying to send XML in following format from C# (DataType string) to SQL Server stored proc:
<Content> </Content>
There is a space which should get stored as it is in SQL Server column. But it gets stored like <Content/>. So in nutshell there is loss of space from c# to SQL Server.
Is there anyway I can avoid this?
The two fragments are equivalent; SQL server is just optimizing the XML.
Is there a particular reason you need the space in there? If so, you might try
xml:space="preserve", like so: