Microsoft KB Archive/297728

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

Article ID: 297728

Article Last Modified on 2/21/2007

-

APPLIES TO


 * Microsoft SQL Server 2000 Analysis Services
 * Microsoft Visual Studio .NET 2002 Professional Edition

-



This article was previously published under Q297728



BUG #: 11289 (Plato7.x)



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.



Steps to Reproduce Behavior
 Create a new C# console application.  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=&quot;Provider=MSOLAP;location=localhost;&quot; + &quot;Mining Persistence Format=1;&quot; + &quot;Mining Location=c:/program files/microsoft analysis services&quot; + &quot;/data/foodmart 2000/member card RDBMS&quot;; cn.Open;

// Set the command text cmd.CommandText=&quot;Create Mining Model cucu &quot; + &quot;( TheKey long key, Age double continuous,&quot; +               &quot;HairColor text discrete PREDICT, Gender text discrete, &quot; +                &quot;CarColor text discrete) using microsoft_decision_trees &quot;; cmd.CommandType = CommandType.Text; cmd.Connection=cn; // Execute the command cmd.ExecuteNonQuery; Console.WriteLine(&quot;Mining Model Creation Completed&quot;); 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.

Additional query words: C# DATA MINING QUERY OLAP

Keywords: kbbug kbfix kbssas800sp1fix KB297728

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.