I created a ContentQueryWebpart in VisualStudio and used properties that I exported from a configured one on a SharePoint site. It works fine so far, but now I want to programmatically change the datasource and contenttype it is getting it's data from.
What I want to achieve is: the webpart should get the current siteURL or webURL it is placed in and get all all tasks of a tasklist in that web and all tasklists of it's subwebs for example.
How do I set those two properties in code?