本文整理匯總了VB.NET中System.Web.DynamicData.MetaModel.Tables屬性的典型用法代碼示例。如果您正苦於以下問題:VB.NET MetaModel.Tables屬性的具體用法?VB.NET MetaModel.Tables怎麽用?VB.NET MetaModel.Tables使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類System.Web.DynamicData.MetaModel
的用法示例。
在下文中一共展示了MetaModel.Tables屬性的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: GetTables
' 導入命名空間
Imports System.Collections
Imports System.Configuration
Imports System.Data
Imports System.Linq
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.HtmlControls
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Xml.Linq
Imports System.Web.DynamicData
Imports System.Text
Partial Public Class _TablesMenu
Inherits System.Web.UI.Page
'Protected Sub Page_Init(ByVal sender As Object, ByVal e As EventArgs)
' GetVisibleTables()
' GetTables()
'End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
'Dim visibleTables As System.Collections.IList = MetaModel.Default.VisibleTables
'If (visibleTables.Count = 0) Then
' Throw New InvalidOperationException("There are no accessible tables. Make sure that at least one data model is registered in Global.asax a" & _
' "nd scaffolding is enabled or implement custom pages.")
'End If
'Menu1.DataSource = visibleTables
'Menu1.DataBind()
GetVisibleTables()
GetTables()
End Sub
' Gets all the tables in the data model.
Protected Sub GetTables()
Dim tables As System.Collections.IList = MetaModel.[Default].Tables
If tables.Count = 0 Then
Throw New InvalidOperationException("There are no tables in the data model.")
End If
Menu2.DataSource = tables
Menu2.DataBind()
End Sub
' Gets only the visible tables in the data model.
Protected Sub GetVisibleTables()
Dim visibleTables As System.Collections.IList = MetaModel.[Default].VisibleTables
If visibleTables.Count = 0 Then
Throw New InvalidOperationException("There are no accessible tables. Make sure that at least one data model is registered in Global.asax and scaffolding is enabled or implement custom pages.")
End If
Menu1.DataSource = visibleTables
Menu1.DataBind()
End Sub
End Class