Creates a new instance of the
ObjectContext Class.
Syntax
| Visual Basic (Declaration) | |
|---|
Public Function New( _
ByVal storage As IStorage _
) |
Parameters
- storage
- Instance of the class that represents the physical storage.
Exceptions
| Exception | Description |
| ArgumentNullException | Storage 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