3

I have built a Analysis Services and apply Data Mining by Bussness Intelligent Development Studio. Now i have a prediction query as the follows:

SELECT
  PredictAssociation([Association].[v User Subscribe Product], INCLUDE_STATISTICS, 3)
From
  [Association]
NATURAL PREDICTION JOIN
(SELECT (SELECT 'Ipad 1' AS [Product Name]
  UNION SELECT 'Ipad 2' AS [Product Name]
  UNION SELECT 'Iphone 3GS' AS [Product Name]
  UNION SELECT 'Iphone 5C' AS [Product Name]) AS [v User Subscribe Product]) AS t

And my result view in SQL Management Studio as the follows:

enter image description here

I using ADOMD.NET to get the READER the show on my application. My code as the belows:

var command = new AdomdCommand(DMXQuery, SqlConnectionHelper.GetConnectionSSAS());
var reader = command.ExecuteReader();

Every things is going to be ok. Reader execute still ok. But i don't know how to get "PRODUCT NAME" exactly. Reader included it, but i dont know how to get.

Does is anybody know this?

Tks for advance.

a_hardin
  • 4,991
  • 4
  • 32
  • 40
Jonny Vu
  • 1,420
  • 2
  • 13
  • 32

1 Answers1

2
while (reader.Read())
{
    Console.Write(reader[0]); // Your product name

    // Other fields
    for (int i = 1; i < reader.FieldCount; i++)
    {
        Console.Write(reader[i] + " ");
    }

    Console.WriteLine();
}
reader.Close();
Andrey Ershov
  • 1,773
  • 1
  • 16
  • 26