Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove "diffgr:before" content from returned dataset via webservice

I have a web method:

public DataSet SyncedWall()
    {
            DataSet dst = dscomment;
            dst.Tables[0].Rows[i]["WallInfo"] = "my own modified value";
            return dst;
    }

Although the real method is big but this is a minified version.

Following is the xml output received from the web method:

<DataSet>
<xs:schema id="NewDataSet">
<!-- Schema goes here.. -->
</xs:schema>

<diffgr:diffgram>

<NewDataSet>
<!-- Dataset values goes here... -->
</NewDataSet>

<diffgr:before>
<!-- Here are the original modified (unwanted) values -->
</diffgr:before>
</diffgr:diffgram>
</DataSet>

What I want is to remove the <diffgr:before> tag and its inner contents. How to do that?

like image 473
necixy Avatar asked May 20 '11 14:05

necixy


1 Answers

Hurreeyyyyyy!!!

I've found the answer after scratching my head upto couples of hours. :P Before returning the dataset just call for datasetObject.AcceptChanges(); and you're done.

So here is the code:

public DataSet SyncedWall()
    {
            DataSet dst = dscomment;
            dst.Tables[0].Rows[i]["WallInfo"] = "my own modified value";
            dst.AcceptChanges();
            return dst;
    }
like image 79
necixy Avatar answered Nov 15 '22 15:11

necixy