Patrik,
You can't control this in DataSet.
You can get around it by creating a new inherited class and overriding this:
protected override bool ShouldSerialize Tables() {
return false;
}
protected override bool ShouldSerialize Relations() {
return false;
}
You might also need to override
MyDataset(Seria lizationInfo info, StreamingContex t context)
and
protected override void ReadXmlSerializ able(XmlReader reader)
and
protected override XmlSchema GetSchemaSerial izable()
but you should test this first before doing so. Clue: look at a typed
dataset implementation (click Show All Files on the Solution Explorer and
look under a Dataset xsd)
Actually if you add a new Dataset.xsd to a project it will create a slightly
more verbose dataset as above but it will not send schema as you desire.
**NB: The problem will be that you cannot read the xml into an empty blank
DataSet as the data will be a diffgram which cannot be inferred, so the
client will need to load the schema from a file first. This can be done in
your MyDataSet(Seria lizationInfo info, StreamingContex t context) constructor
before loading the xml stream.
Hope that's what you wanted. The only reason I can think why you want to do
this is to avoid publishing a TypedDataSet class on the client side, but you
need to do this anyway with the above implementation, or that you want to
avoid the overhead of using typed datasets, in which case do as I mentioned.
The other nice thing is that you could alter the serialization to not
generate a diffgram if you don't care about tracking changes. This will give
you a slight reduction in xml serialization size.
Regards,
John
"Patrik" <Pa****@discuss ions.microsoft. com> wrote in message
news:55******** *************** ***********@mic rosoft.com...
Hi
I want to return a dataset from a webservice and exclude the schema.
How can I do this?
/Patrik