I have many reports in PPS that have about 60 data sources for analysis services. I want to change my connection string (i.e., I want to change the server they are pointing to). I tried the solution below (console application) to get a list of data sources available in SharePoint for PPS, but cannot see / change connection strings.
static void Main(string[] args) { DataTable dt = new DataTable(); dt = GetList("SharePoint site URL", "Data Connections"); } public static DataTable GetList(string site, string listname) { ClientContext ctx = new ClientContext(site); List lst = ctx.Web.Lists.GetByTitle(listname); CamlQuery cq = CamlQuery.CreateAllItemsQuery(); ListItemCollection lic = lst.GetItems(cq); ctx.Load(lic); ctx.ExecuteQuery(); DataTable dt = new DataTable(); foreach (var field in lic[0].FieldValues.Keys) { dt.Columns.Add(field); } foreach (var item in lic) { DataRow dr = dt.NewRow(); foreach (var obj in item.FieldValues) { if (obj.Value != null) { string type = obj.Value.GetType().FullName; if (type == "Microsoft.SharePoint.Client.FieldLookupValue") { dr[obj.Key] = ((FieldLookupValue)obj.Value).LookupValue; } else if (type == "Microsoft.SharePoint.Client.FieldUserValue") { dr[obj.Key] = ((FieldUserValue)obj.Value).LookupValue; } else { dr[obj.Key] = obj.Value; } } else { dr[obj.Key] = null; } } dt.Rows.Add(dr); } return dt; }
With the above code, I get all data connections in the "Data Connections" list (below screenshot is a data table structure)

Unfortunately, this information does not have a connection string. I can not find any solution on the Internet.
source share