.NET Questions and Solutions

As a software engineer, I focus on .NET, especially asp.net, C#, WCF and so on, and I am also very interested in Search Engine Optimization.

Entries Tagged ‘reference’

ACC2000: How to Reference Classes That Exist in Multiple Libraries

Symptoms
If your Microsoft Access database contains a reference to multiple librarydatabases, type libraries, or object libraries, it is possible for the sameclass name to exist in more than one referenced file. If you want todeclare a variable of that type, you must explicitly state which referencecontains the class that you want to use. This article shows you how tospecify a particular reference file in code.
Resolution
Suppose that your Microsoft Access database contains two references: onereference to a library database called MyDatabase, which contains a classcalled RecordSet, and another reference to Microsoft DAO 3.6 ObjectLibrary, which also contains a class called RecordSet. To dimension a variable of type RecordSet from the MyDatabase reference, you must use the following syntax:

Dim rs as MyDatabase.RecordSet If you do not explicitly declare the reference name when you dimension thevariable, whichever reference appears first in the References dialogbox is automatically assumed. If the wrong reference is assumed, you mayencounter error messages when you try to use the properties and methods ofthe declared object.
You can use the Microsoft Access Object Browser to determine the referencename. To use the Object Browser, open any module in Design view, and thenclick Object Browser on the View menu (or press the F2 key). The name that appears in the Project/Library box of the Object Browser is the name of that reference.

ACC2000: Error Messages That Indicate a Missing Reference

Symptoms
If you have not set the appropriate references in Access 2000, you may receive one of the following error messages when you run code that includes an object from a missing reference:

Variable not defined.
-or-

Run-time error ‘5′:
Invalid procedure call or argument.
-or-

Microsoft Visual Basic
The library which contains this symbol is not referenced by the current project, so the symbol is undefined. Would you like to add a reference to the containing library now?
-or-

Compile Error: Can’t find project or library.
Resolution
Your database contains a reference to a database, a type library, or an object library that is marked as MISSING: <referencename> in the References dialog box.

A memory leak may occur when you use data binding in Windows Presentation Foundation

Symptoms
When you use data binding in Microsoft Windows Presentation Foundation (WPF), a memory leak may occur.
Resolution
This issue occurs if the following conditions are true:A data-binding path refers to property P of object X.Object X contains a direct reference or an indirect reference to the target of the data-binding operation.Property P is accessed through a PropertyDescriptor object instead of a DependencyProperty objector a PropertyInfo object.