How to create local cube using adomd.net and C# -
10-01-2004
, 04:07 PM
I've instaled adomd.net
I can connect with local cube :
AdomdConnection conn=new AdomdConnection();
connection.ConnectionString = "DATASOURCE='c:\\cube.cub'";
but I can't create local cube.
I tried :
string s= "DATASOURCE=C:\\MySales2.cub;" +
"SOURCE_DSN=\"Provider=MSOLAP;DATA SOURCE=LOCAL;INITIAL CATALOG=FoodMart
2000\";"
"CREATECUBE=\"CREATE CUBE MySales(" +
" DIMENSION Time TYPE TIME," +
" LEVEL Year TYPE YEAR," +
" DIMENSION Product," +
" LEVEL [All Products] TYPE All," +
" LEVEL [Product Family]," +
" LEVEL [Product Department]," +
" MEASURE [Unit Sales] Function SUM)\";" +
"INSERTINTO=\"INSERT INTO MySales(" +
" Time.Year," +
" Product.[Product Family]," +
" Product.[Product Department]," +
" Measures.[Unit Sales])" +
" SELECT " +
" Sales.[Time:Year]," +
" Sales.[Product:Product Family]," +
" Sales.[Product:Product Department]," +
" Sales.[measures:Unit Sales]" +
" FROM Sales" +
" WHERE Sales.[Time:year]='1997'\"";
AdomdConnection conn=new AdomdConnection();
AdomdConnection.ConnectionString=s;
AdomdConnection.Open();
This connection string works with com adomd but in adomd.net I got
ErrorCode -2147217805. |