Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Avoiding the XML preserve syntax
Message
From
30/04/2006 13:11:21
 
 
To
30/04/2006 01:44:35
General information
Forum:
ASP.NET
Category:
XML
Miscellaneous
Thread ID:
01117317
Message ID:
01117907
Views:
15
And one more thing ... the behavior seems to still be dependent on whether your database column's datatype is char or varchar. If you use varchar and your column is truly empty (no extra spaces), you won't see the xml:space="preserve" get added to the XML. But if your column is char, then it's never really empty ... it's always padded with spaces no matter what you do and so you'll get the stuff added to the XML. This is how it works in SQL Server anyway, I'm not sure if it's different or not for other databases.

~~Bonnie



>>On further experimentation, it seems this is something extra that's been added to 2.0 when you use a DataAdapter.Fill(). I don't know how to turn it off. Further experimentation may be necessary. I don't know if this is a good thing or not (I hate things that aren't backwards compatible).
>
>Well, personally, I don't think this is a good idea. Basically, if you don't trim, you end up with extra fields in the spreadsheet and this just doesn't make any sense to me.
>
>So, I'll keep those trim in there until a fix is done.
>
>Thanks for having done some research on the topic. At least, we know this is something to 2.0.
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform