FIX: Unhandled Exception Error Querying with the Data Mining Provider from ADO+ and C#

Article translations Article translations
Article ID: 297728 - View products that this article applies to.
This article was previously published under Q297728
This article has been archived. It is offered "as is" and will no longer be updated.
BUG #: 11289 (Plato7.x)
Expand all | Collapse all

On This Page

SYMPTOMS

When you execute a query with the Data Mining provider using ActiveX Data Objects (ADO+) from a Microsoft C# application, the application fails with an error message that resembles the following:
An unhandled exception of type 'System.Security.SecurityException' occurred in C:\WINNT\Microsoft.NET\Framework\v1.0.2204\System.Data.DLL

RESOLUTION

To resolve this problem, obtain the latest service pack for the Microsoft SQL Server 2000 (the Analysis Services Components - Sql2kasp1.exe). For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
290211 INF: How to Obtain the Latest SQL Server 2000 Service Pack

STATUS

Microsoft has confirmed that this is a problem in SQL Server 2000 Analysis Services version 8.0. This problem was first corrected in the Analysis Services Components of Microsoft SQL Server 2000 Service Pack 1.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a new C# console application.
  2. Add the following code to the application:
    using System;
    using System.Data;
    using System.Data.OleDb;
    
    namespace DataMine
    {
       class Class1
       {
          [STAThread]
          static void Main(string[] args)
          {
             try
             {
                // Create a connection and a command object  
                OleDbConnection cn = new OleDbConnection();
                OleDbCommand cmd = new OleDbCommand();
                // Set the Connection String
                cn.ConnectionString="Provider=MSOLAP;location=localhost;" + 
                   "Mining Persistence Format=1;" + 
                   "Mining Location=c:/program files/microsoft analysis services" + 
                   "/data/foodmart 2000/member card RDBMS";
                cn.Open();
    
                // Set the command text
                cmd.CommandText="Create Mining Model cucu  " + 
                   "( TheKey long key, Age double continuous," + 
                   "HairColor text discrete PREDICT, Gender text discrete, " + 
                   "CarColor text discrete) using microsoft_decision_trees ";
                cmd.CommandType = CommandType.Text;
                cmd.Connection=cn;
                // Execute the command
                cmd.ExecuteNonQuery();
                Console.WriteLine("Mining Model Creation Completed");
                Console.ReadLine();
             }
          catch(System.Exception e)
             {
                Console.WriteLine(e.Message.ToString());
                Console.ReadLine();
             }
          }
       }
    }
    
    					
(c) Microsoft Corporation 2001, All Rights Reserved. Contributions by John Desch, Microsoft Corporation.

Properties

Article ID: 297728 - Last Review: February 27, 2014 - Revision: 3.3
APPLIES TO
  • Microsoft SQL Server 2000 Analysis Services
  • Microsoft Visual Studio .NET 2002 Professional Edition
Keywords: 
kbnosurvey kbarchive kbbug kbfix kbssas800sp1fix KB297728

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com