Hi, friends, thank you very much to read my question as below:
I 'am using the AMO, and meet a question about the DataSourceView object.
My question is very simple:
After I added a column into a source table in the SQL Server, how to get the change into the DataSourceView object?
Background:
I have a cube in my OLAP Server, and I connect with it in my application with AMO. My task is to add a new measure, mapping to a new column I just added into the source table, just like this:
Dim meas As Microsoft.AnalysisServices.Measure
meas = Mainform.tDatabase.Cubes(0).MeasureGroups(0).Measures.Add()
meas.Source = CreateDataItem(Mainform.tDatabase.DataSourceViews(0), TableName, ColumnName)
But my problem is that the table schema in the DataSourceViews(0) doesn't include the column just added.
How could I update the DataSourceViews? I tried the Update() method, but that's is used to update the the OLAP server, not what I want to do. I want to update the DataSourceViews object itself refering to the SQL Server's table schema.
Thanks!
Have you added the column to your datatable that you use to populate your DSV ?|||
sorry, I dont' catch your mean. I have added the column to the source table in the database of the sql server 2005. What is your mean of "MY Datatable use to populate my DSV"? Perhaps, you could teach me how to populate my DSV based on the datatable in the sql server 2005.
Thanks.
|||Hi,Take a look at this If you scroll down to the part where it says "DataSourceView Objects", you will see that they are using SQL to populate a datatable to fill the datasourceview. This is very similar to what you will do, You've added the new column in the table in your database, now you've got to query that column, to add it to the datatable.
Hope that makes sense,
C
No comments:
Post a Comment