public override List<SchemaView> GetViews(string owner)
 {
     using (DbConnectionInfo cn = Db.CreateConnection())
     {
         // owner, view name
         DataTable dt = cn.GetSchema("Views", new string[] { owner, null });
         DataRowCollection drc = dt.Rows;
         List<SchemaView> list = new List<SchemaView>(drc.Count);
         for (int i = 0; i < drc.Count; i++)
         {
             SchemaView item = new SchemaView();
             item.Owner = drc[i]["OWNER"].IfNull(String.Empty);
             item.Name = drc[i]["VIEW_NAME"].IfNull(String.Empty);
             item.IsUpdatable = false;
             item.Definition = drc[i]["TEXT"].IfNull(String.Empty);
             list.Add(item);
         }
         return list;
     }
 }
        public override List<SchemaView> GetViews(string owner)
        {
            using (DbConnectionInfo cn = Db.CreateConnection())
            {
                using (DbCommand cm = cn.CreateCommand())
                {
                    string sql = String.Format(@"SELECT * FROM INFORMATION_SCHEMA.VIEWS
                        WHERE TABLE_CATALOG={0} and (TABLE_SCHEMA={1} or {1}='NULL')
                        ORDER BY TABLE_NAME",
                        Db.GetParameterMarker("database"),
                        Db.GetParameterMarker("owner"));

                    cm.CommandText = sql;
                    cm.Parameters.Add(Db.CreateParameter("database", cn.Database));
                    cm.Parameters.Add(Db.CreateParameter("owner", owner.IfNull("NULL")));
                    DataTable dt = Db.ExecQuery(cm);
                    DataRowCollection drc = dt.Rows;
                    List<SchemaView> list = new List<SchemaView>(drc.Count);
                    for (int i = 0; i < drc.Count; i++)
                    {
                        SchemaView item = new SchemaView();
                        item.Owner = drc[i]["TABLE_SCHEMA"].IfNull(String.Empty);
                        item.Name = drc[i]["TABLE_NAME"].IfNull(String.Empty);
                        item.IsUpdatable = drc[i]["IS_UPDATABLE"].Equals("YES");
                        item.Definition = drc[i]["VIEW_DEFINITION"].IfNull(String.Empty);
                        list.Add(item);
                    }
                    return list;
                }
            }
        }