* RecordCache.cs: Reduce some extraneous nesting.
[mono.git] / mcs / class / System.Data / System.Data.Common / DbDataReader.cs
index f9463bb8c4a2542250f13ff1827204b7e9d87f7e..7d046978a41ca66e73a53f66a106efa4ae174289 100644 (file)
@@ -58,7 +58,6 @@ namespace System.Data.Common {
                public abstract int RecordsAffected { get; }
 
 #if NET_2_0
-               [MonoTODO]
                public virtual int VisibleFieldCount {
                        get { return FieldCount; }
                }
@@ -86,11 +85,10 @@ namespace System.Data.Common {
                                Close ();
                }
 #if NET_2_0
-               [MonoTODO]
                [EditorBrowsable (EditorBrowsableState.Never)]
                public DbDataReader GetData (int i)
                {
-                       throw new NotImplementedException ();
+                       return ((DbDataReader) this [i]);
                }
 #endif
 
@@ -112,31 +110,27 @@ namespace System.Data.Common {
                public abstract int GetOrdinal (string name);
 
 #if NET_2_0
-               [MonoTODO]
                [EditorBrowsable (EditorBrowsableState.Never)]
                public virtual Type GetProviderSpecificFieldType (int i)
                {
                        return GetFieldType (i);
                }
 
-               [MonoTODO]
                [EditorBrowsable (EditorBrowsableState.Never)]
                public virtual object GetProviderSpecificValue (int i)
                {
                        return GetValue (i);
                }
 
-               [MonoTODO]
                [EditorBrowsable (EditorBrowsableState.Never)]
                public virtual int GetProviderSpecificValues (object[] values)
                {
                        return GetValues (values);
                }
        
-               [MonoTODO]
                protected virtual DbDataReader GetDbDataReader (int ordinal)
                {
-                       throw new NotSupportedException ();
+                       return ((DbDataReader) this [ordinal]);
                }
 #endif 
 
@@ -156,36 +150,36 @@ namespace System.Data.Common {
 
                 internal static DataTable GetSchemaTableTemplate ()
                {
-                       Type booleanType        = Type.GetType ("System.Boolean");
-                       Type stringType         = Type.GetType ("System.String");
-                       Type intType            = Type.GetType ("System.Int32");
-                       Type typeType           = Type.GetType ("System.Type");
-                       Type shortType          = Type.GetType ("System.Int16");
+                       Type booleanType = typeof (bool);
+                       Type stringType = typeof (string);
+                       Type intType = typeof (int);
+                       Type typeType = typeof (Type);
+                       Type shortType = typeof (short);
 
                        DataTable schemaTable = new DataTable ("SchemaTable");
-                       schemaTable.Columns.Add ("ColumnName",          stringType);
-                       schemaTable.Columns.Add ("ColumnOrdinal",       intType);
-                       schemaTable.Columns.Add ("ColumnSize",          intType);
-                       schemaTable.Columns.Add ("NumericPrecision",    shortType);
-                       schemaTable.Columns.Add ("NumericScale",        shortType);
-                       schemaTable.Columns.Add ("IsUnique",            booleanType);
-                       schemaTable.Columns.Add ("IsKey",               booleanType);
-                       schemaTable.Columns.Add ("BaseServerName",      stringType);
-                       schemaTable.Columns.Add ("BaseCatalogName",     stringType);
-                       schemaTable.Columns.Add ("BaseColumnName",      stringType);
-                       schemaTable.Columns.Add ("BaseSchemaName",      stringType);
-                       schemaTable.Columns.Add ("BaseTableName",       stringType);
-                       schemaTable.Columns.Add ("DataType",            typeType);
-                       schemaTable.Columns.Add ("AllowDBNull",         booleanType);
-                       schemaTable.Columns.Add ("ProviderType",        intType);
-                       schemaTable.Columns.Add ("IsAliased",           booleanType);
-                       schemaTable.Columns.Add ("IsExpression",        booleanType);
-                       schemaTable.Columns.Add ("IsIdentity",          booleanType);
-                       schemaTable.Columns.Add ("IsAutoIncrement",     booleanType);
-                       schemaTable.Columns.Add ("IsRowVersion",        booleanType);
-                       schemaTable.Columns.Add ("IsHidden",            booleanType);
-                       schemaTable.Columns.Add ("IsLong",              booleanType);
-                       schemaTable.Columns.Add ("IsReadOnly",          booleanType);
+                       schemaTable.Columns.Add ("ColumnName",       stringType);
+                       schemaTable.Columns.Add ("ColumnOrdinal",    intType);
+                       schemaTable.Columns.Add ("ColumnSize",       intType);
+                       schemaTable.Columns.Add ("NumericPrecision", shortType);
+                       schemaTable.Columns.Add ("NumericScale",     shortType);
+                       schemaTable.Columns.Add ("IsUnique",         booleanType);
+                       schemaTable.Columns.Add ("IsKey",            booleanType);
+                       schemaTable.Columns.Add ("BaseServerName",   stringType);
+                       schemaTable.Columns.Add ("BaseCatalogName",  stringType);
+                       schemaTable.Columns.Add ("BaseColumnName",   stringType);
+                       schemaTable.Columns.Add ("BaseSchemaName",   stringType);
+                       schemaTable.Columns.Add ("BaseTableName",    stringType);
+                       schemaTable.Columns.Add ("DataType",         typeType);
+                       schemaTable.Columns.Add ("AllowDBNull",      booleanType);
+                       schemaTable.Columns.Add ("ProviderType",     intType);
+                       schemaTable.Columns.Add ("IsAliased",        booleanType);
+                       schemaTable.Columns.Add ("IsExpression",     booleanType);
+                       schemaTable.Columns.Add ("IsIdentity",       booleanType);
+                       schemaTable.Columns.Add ("IsAutoIncrement",  booleanType);
+                       schemaTable.Columns.Add ("IsRowVersion",     booleanType);
+                       schemaTable.Columns.Add ("IsHidden",         booleanType);
+                       schemaTable.Columns.Add ("IsLong",           booleanType);
+                       schemaTable.Columns.Add ("IsReadOnly",       booleanType);
 
                        return schemaTable;
                }