Chili.Opf3 Send comments on this topic.
ObjectContext Constructor
See Also  Example
Chili.Opf3 Namespace > ObjectContext Class : ObjectContext Constructor




storage
Instance of the class that represents the physical storage.
Creates a new instance of the ObjectContext Class.

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal storage As IStorage _
)
Visual Basic (Usage)Copy Code
Dim storage As IStorage
 
Dim instance As ObjectContext(storage)
C# 
public ObjectContext( 
   IStorage storage
)
Managed Extensions for C++ 
public: ObjectContext( 
   IStorage* storage
)
C++/CLI 
public:
ObjectContext( 
   IStorage^ storage
)

Parameters

storage
Instance of the class that represents the physical storage.

Exceptions

ExceptionDescription
ArgumentNullExceptionStorage is null.

Example

The following example shows how to create a new ObjectContext.
C#Copy Code
// Creates a new ObjectContext that uses an MsSql Server as storage. 
ObjectContext context = new ObjectContext(new MsSqlStorage("sa", "",  
    "localhost", "application")); 
    

Requirements

Platforms: Windows 2000, Windows XP family, Windows Server 2003 family, Windows Vista family

See Also