469,591 Members | 2,068 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,591 developers. It's quick & easy.

XML reading database null value as an empty string ""

I am using the XMLTextWriter to build an XML string and pass it to the
XMLDocument. When I get the data from SQL Server, some of the values
passed to the XML are NULL in the database. When I try and run an
update to database using the same XML string, (using SQL parameters to
pass the selectsinglenode), the XML always shows the NULL values as an
empty string "". This is then updating the database with an empty
value rather than keeping the NULL (which if the XML passed single
quotes, I assume the NULL would be there).

I use the SqlDbType to set the datatype of each parameter I pass.
I've had to set up all paramerter value types with the ConvertTo.Int32
when I have an Int datatype... Do I need to convert my char and
varchar fields so I can get a NULL value rather than the empty string?

I'm very new to all this. If you need more information to help me
resolve this problem, please let me know.
Nov 16 '05 #1
0 1963

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by aa | last post: by
2 posts views Thread by Denis Perelyubskiy | last post: by
13 posts views Thread by Don Vaillancourt | last post: by
5 posts views Thread by rengeek33 | last post: by
2 posts views Thread by Jeff | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.