I'm not a C#/DSO expert, but the following code seems to work:
using System;
namespace DSO
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
try
{
DSO.Server dsoServer = new DSO.Server();
DSO.MDStore dsoDB;
DSO.MiningModel dsoDMM;
// Connect to the server on this computer.
dsoServer.Connect("LocalHost");
// Select the FoodMart 2000 database.
dsoDB = (MDStore)dsoServer.MDStores.Item("TEST");
// Select the mining model
dsoDMM = (MiningModel)dsoDB.MiningModels.Item("CP");
// Process the data mining model.
DSO.OlapLockTypes olapLock = DSO.OlapLockTypes.olapLockProcess;
string strMsg = null;
dsoDMM.LockObject(ref olapLock, ref strMsg);
dsoDMM.Process(DSO.ProcessTypes.processFull);
dsoDMM.UnlockObject();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
}
}
}
For the second question, you could use the following DMX (not MDX) query:
select node_caption, node_description, node_rule from [CP].content
See the FAQ on VB app and samples for DMX.
--
Peter Kim
This posting is provided "AS IS" with no warranties, and confers no rights.
[quoted text, click to view] "oshadha" <anonymous@discussions.microsoft.com> wrote in message
news:45FEE6C0-849E-4C08-9B35-8E1077D241BF@microsoft.com...
> Hi all,
> this is regard to the massage "SQL server books online mining model sample
VB6 to C#" replied by Peter Kim ...I have added the DSO referance already
but converting VB6 code Set dsoDB = dsoServer.MDStores("FoodMart 2000") to
C# coding is difficult.
[quoted text, click to view] > and also is it possible to get the number of nodes of a data mining model
created in analysis services and the 'node path' information using MDX ? i
have not seen a function to obtain these details in the SQL books
online.....
[quoted text, click to view] > thanks a lot,
> Oshadha.
>