N
nano2k
Hi
I'm facing a performance issue with my webservice.
I have a webmethod that returns the result of an sql query. I use an
SqlDataAdapter object that fills an DataSet object with my results. My
problem is that I need to alter a bit my results. For each record I
need to append some new data. So, my current implementation builds a
new XmlDocument which will be filled step by step while looping
through dataset rows and appending my custom info. Finally, the xml
document is sent as the response to the calling client application.
The problem is that using this method allows me to append any
information I need, but the cost is sometimes too big (processing
power + memory) because my method practically doubles the memory
needed for the response to be sent: first, the dataset allocates,
let's say, 10MB, then, I reallocate 10MB (plus 1MB of custom data) to
build my custom response. So, at one moment in processing, my method
allocates 20+ MB.
To avoid this, I think the best way is to alter the dataset itself by
attaching new attributes to each element that represents a record.
Is there a way to access and modify this intimate XML representation
of a dataset?
Thanks.
I'm facing a performance issue with my webservice.
I have a webmethod that returns the result of an sql query. I use an
SqlDataAdapter object that fills an DataSet object with my results. My
problem is that I need to alter a bit my results. For each record I
need to append some new data. So, my current implementation builds a
new XmlDocument which will be filled step by step while looping
through dataset rows and appending my custom info. Finally, the xml
document is sent as the response to the calling client application.
The problem is that using this method allows me to append any
information I need, but the cost is sometimes too big (processing
power + memory) because my method practically doubles the memory
needed for the response to be sent: first, the dataset allocates,
let's say, 10MB, then, I reallocate 10MB (plus 1MB of custom data) to
build my custom response. So, at one moment in processing, my method
allocates 20+ MB.
To avoid this, I think the best way is to alter the dataset itself by
attaching new attributes to each element that represents a record.
Is there a way to access and modify this intimate XML representation
of a dataset?
Thanks.