Some of the Commonly Used Methods with Short Code SnippetsAll snippets require a proper SSRS endpoint reference as described earlier in the chapter, web and SOAP proxy references, and the following calls prior to calling any of the methods: ReportingService2005 rs = new ReportingService2005(); rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
Method calls can also be grouped together and executed as a single transaction, that is, commit and rollback as a whole. The following code snippet shows how this could be accomplished: BatchHeader bh = new BatchHeader(); bh.BatchID = rs.CreateBatch(); rs.BatchHeaderValue = bh; rs.<<MethodCall, like DeleteItem>>; rs.<<MethodCall>>; ... rs.ExecuteBatch(); |