Esempio n. 1
0
 // <Snippet61>
 // Gets all the tables in the data model.
 protected void GetTables()
 {
     System.Collections.IList tables =
         MetaModel.Default.Tables;
     if (tables.Count == 0)
     {
         throw new InvalidOperationException(
                   "There are no tables in the data model.");
     }
     Menu2.DataSource = tables;
     Menu2.DataBind();
 }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            System.Collections.IList l2sTables = Global.L2Smodel.VisibleTables;
            System.Collections.IList efTables  = Global.EFmodel.VisibleTables;
            if (l2sTables.Count == 0 && efTables.Count == 0)
            {
                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.");
            }
            Menu1.DataSource = l2sTables;
            Menu1.DataBind();

            Menu2.DataSource = efTables;
            Menu2.DataBind();
        }