/// <remarks/>
 public void SetDataSourceContentsAsync(string DataSource, DataSourceDefinition Definition)
 {
     this.SetDataSourceContentsAsync(DataSource, Definition, null);
 }
 /// <remarks/>
 public void SetDataSourceContentsAsync(string DataSource, DataSourceDefinition Definition, object userState)
 {
     if ((this.SetDataSourceContentsOperationCompleted == null))
     {
         this.SetDataSourceContentsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetDataSourceContentsOperationCompleted);
     }
     this.InvokeAsync("SetDataSourceContents", new object[]
     {
         DataSource,
         Definition
     }, this.SetDataSourceContentsOperationCompleted, userState);
 }
 public void SetDataSourceContents(string DataSource, DataSourceDefinition Definition)
 {
     this.Invoke("SetDataSourceContents", new object[]
     {
         DataSource,
         Definition
     });
 }
 /// <remarks/>
 public void CreateDataSourceAsync(string DataSource, string Parent, bool Overwrite, DataSourceDefinition Definition, Property[] Properties, object userState)
 {
     if ((this.CreateDataSourceOperationCompleted == null))
     {
         this.CreateDataSourceOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateDataSourceOperationCompleted);
     }
     this.InvokeAsync("CreateDataSource", new object[]
     {
         DataSource,
         Parent,
         Overwrite,
         Definition,
         Properties
     }, this.CreateDataSourceOperationCompleted, userState);
 }
 /// <remarks/>
 public void CreateDataSourceAsync(string DataSource, string Parent, bool Overwrite, DataSourceDefinition Definition, Property[] Properties)
 {
     this.CreateDataSourceAsync(DataSource, Parent, Overwrite, Definition, Properties, null);
 }
 public void CreateDataSource(string DataSource, string Parent, bool Overwrite, DataSourceDefinition Definition, Property[] Properties)
 {
     this.Invoke("CreateDataSource", new object[]
     {
         DataSource,
         Parent,
         Overwrite,
         Definition,
         Properties
     });
 }
        public void CreateDataSource(string datasourceName, string datasourcePath, string connectDs, string connectDatabase, string connUsername, string connPass)
        {
            // /MSI Report Demo/Data Sources
            datasourcePath = datasourcePath.Replace(@"\", "/");
            while (datasourcePath.Contains("//"))
            {
                datasourcePath = datasourcePath.Replace("//", "/");
            }

            datasourcePath = datasourcePath.TrimStart('/').TrimEnd('/').Trim();
            datasourcePath = string.Format("/{0}", datasourcePath);

            var dSource = new DataSource();
            var dDefinition = new DataSourceDefinition();

            //if (!CheckExist(ItemTypeEnum.Folder, "/", "Data Sources"))
            //{
            //    rs.CreateFolder("Data Sources", "/", null);
            //}

            //if (!CheckExist(ItemTypeEnum.Folder, "/MSI Report Demo", "/Data Sources"))
            //{
            //    rs.CreateFolder("Data Sources", "/MSI Report Demo", null);
            //}

            dSource.Item = dDefinition;
            dDefinition.Extension = "SQL";
            dDefinition.ConnectString = string.Format("{0}{1};Initial Catalog={2}", @"Data Source=", connectDs, connectDatabase);
            dDefinition.UserName = connUsername;
            dDefinition.Password = connPass;

            Trace.WriteLine(dDefinition.ConnectString);

            dDefinition.ImpersonateUserSpecified = true;
            dDefinition.Prompt = null;
            dDefinition.WindowsCredentials = false;
            dDefinition.CredentialRetrieval = CredentialRetrievalEnum.Store;
            dSource.Name = datasourceName;

            //if (!CheckExist(ItemTypeEnum.DataSource, "/MSI Report Demo/Data Sources", "/" + dataSourceName))
            //{
            this._rs.CreateDataSource(datasourceName, datasourcePath, true, dDefinition, null);   // overwrite, so, don't check exists datassouce
            //}
        }