Saturday, February 25, 2012

AMO: refresh DSV and accept changes..

I tried the sql server OLAP newsgroup, but without success... this is fairly urgent, so will try in here:
I am stumped on this, how can I programmatically do what can be done in
Visual Studio by:
1. Right clicking inside datasource view
2. Choosing refresh
3. Accepting the changes

I am trying to get new fact table columns into the DSV, obviously
without doing the manual steps above.

I have tried dsv.Refresh() and dsv.Update() but it is not as simple as
that or the sequencing is incorrect (or, most likely, I am looking in
entirely the wrong place).

Thanks for any help.

There is no programmatiic way to do refresh on DSV. However, You can use data adapter to fill schema and get a new datatable and merge the table yourself.

For adding a column, you can use data adapter to do FillSchema() with the table you want to refresh and add the new column into existing table. Finally, call DSV.Update().

|||Thanks for the response - this was pretty much the only way we could solve this as well.... but why isn't the method that MS uses to do this exposed for our use as well? It seems like they have a pretty efficient way of doing this. Nearly everything else allows you to "script the action", why not this?
|||This refresh of DSV from relational DB is part of the execution of DSV but not on AMO. Although we found that it is useful if we move the code to AMO, it is to late of the cycle. Since it has work around, so we cut this feature. We will consider it in next release. Thanks

No comments:

Post a Comment