Groups | Blog | Home
all groups > sql server data mining > march 2004 >

sql server data mining : SQL server books online mining model sample VB6 to C#" cont...


oshadha
3/19/2004 1:01:06 AM
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.
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.....
thanks a lot,
Oshadha.
Peter Kim [MS]
3/19/2004 3:07:07 PM
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]
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]
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]

AddThis Social Bookmark Button