Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class SSRSReportsGenerator: MarshalByRefObject, ISSRSReports
- {
- // Creating Reporting Service Object.
- ReportingService2005 RS;
- public SSRSReportsGenerator()
- {
- RS = new ReportingService2005();
- RS.Credentials = System.Net.CredentialCache.DefaultCredentials;
- }
- public void CreateDataSource()
- {
- string name = "DataSource1";
- string parent = "/MTVN Reports";
- // Define the data source definition.
- DataSourceDefinition definition = new DataSourceDefinition();
- RS.Credentials = System.Net.CredentialCache.DefaultCredentials;
- RS.UseDefaultCredentials= false;
- definition.CredentialRetrieval = CredentialRetrievalEnum.Integrated;
- definition.UserName = "sa";
- definition.Password = "sa123";
- definition.ConnectString = "";
- definition.Enabled = true;
- definition.EnabledSpecified = true;
- definition.Extension = "DATASET";
- definition.ImpersonateUser = false;
- definition.ImpersonateUserSpecified = false;
- definition.Prompt = null;
- definition.WindowsCredentials = false;
- try
- {
- RS.CreateDataSource(name, parent, true, definition, null); // Getting error on this line
- }
- catch (Exception e)
- {
- Console.WriteLine(e.Message);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement