MetaModel.GetTable Method (String, Type)

 

Returns the metadata that describes the specified table.

Namespace:   System.Web.DynamicData
Assembly:  System.Web.DynamicData (in System.Web.DynamicData.dll)

Public Function GetTable (
	tableName As String,
	contextType As Type
) As MetaTable

Parameters

tableName
Type: System.String

The name of the table.

contextType
Type: System.Type

The data context to search for the table.

Return Value

Type: System.Web.DynamicData.MetaTable

The metadata that describes the specified table.

Exception Condition
ArgumentNullException

tablename or contextType is null.

ArgumentException

The context is not registered or the table does not exist in the data context.

The following example shows how to use the GetTable(String, Type) method to obtain the metadata for the specified table. For a complete example, see GetTable.

' Get the metatable for the table with the 
' specified table name and the specified data
' context.
mTable = model.GetTable("CustomerAddresses", GetType(AdventureWorksLTDataContext))

.NET Framework
Available since 3.5
Return to top
Show: