Microsoft KB Archive/311522

= BUG: You cannot create calculated expressions on DataSet objects in the Schema Designer =

Article ID: 311522

Article Last Modified on 3/9/2006

-

APPLIES TO


 * Microsoft .NET Framework 1.1 Service Pack 1
 * Microsoft .NET Framework 1.1

-



This article was previously published under Q311522



This article refers to the following Microsoft .NET Framework Class Library namespace:
 * System.Data



SYMPTOMS
 When you add an instance of a calculated expression in the Schema Designer and you preview that expression, the following error message appears and you are not allowed to create the instance.

Exception has been thrown by the target of an invocation

-or-

 When you modify a DataSet object to add a calculated expression, the form will not load and the Form Designer will display the following error message:

An exception occurred while trying to create an instance of DataSet

If this occurs, you must fix the problem manually before you can see the form again.



CAUSE
The DataSet tries to use rows that have not yet been defined to create the expression.



RESOLUTION
To work around this problem, create the expressions after you instantiate the DataSet. After you create the tables and rows in the DataSet constructor, the expressions will be accepted. For example: Dim objDS as new DataSet1 objDS.myTable.AvgColumn.Expression = &quot;avg(Child.Values)&quot;



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

Additional query words: kbreadme

Keywords: kbtshoot kberrmsg kbbug kbmisctools kbpending kbreadme kbsystemdata KB311522

-

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

© Microsoft Corporation. All rights reserved.