filtering the received xml from DataSet.GetXml()

G

Guest

hi, I'm sorry if this isn't the right group, I just didnt know which category
to place this question in.
Anyway, I have 2 problems: I got a web service which connects to a DB and
puts the data in a DataSet, and sends back to the user the DataSet.GetXml()
(I know that a Dataset is serializable, but i need it's xml. anyway, this
method does not create tags with no values in the output xml, in case a
certain field in the DB equals DBNull.value, and i need it to do so - i need
it to create those fields, and not place any value in them. i thought maybe
there's a way to create a special schema to filter the output xml, but i know
to apply schemas only on the xml, which in that stage, its already too late,
because i need the schema to be applied in the dataset stage.

Also, i need the ouput xml to distinguish which field is the primary key
field in the DB table, somehow let the Dataset know which field is it, and
again - apply a schema (or any other way) on the dataset, that when i call
the method GetXml() - i'll get the xml updated - with an attribute
"<FIELD_NAME is_primary_key="true">value</FIELD_NAME>", and for all fields
which doesn't have any values stored for them in the DB -
"<FIELD_NAME></FIELD_NAME>".
btw - i work with oracle oledb.

thank you
 
G

Guest

I would think a defined schema could force creation of XML nodes
corresponding to fields with no value, but the easiest workaround is to put
some dummy values in your DB fields as defaults; e.g. empty strings, zeros,
etc. instead of NULL values.

-Matt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top