+2008-08-26 Veerapuram Varadhan <vvaradhan@novell.com>
+
+ Patch provided by Ernesto <equistango@gmail.com>
+ * OdbcDataReader.cs: Don't call GetSchemaTable in the constructor
+ instead just get column information. Enhances performance of
+ DataReader.
+
2008-08-26 Veerapuram Varadhan <vvaradhan@novell.com>
Patch provided by Ernesto <equistango@gmail.com>
short colcount = 0;
libodbc.SQLNumResultCols (hstmt, ref colcount);
cols = new OdbcColumn [colcount];
- GetSchemaTable ();
+ GetColumns ();
}
internal OdbcDataReader (OdbcCommand command, CommandBehavior behavior,
}
return cols [ordinal];
}
+
+ // Load all column descriptions
+ private void GetColumns ()
+ {
+ for(int i = 0; i < cols.Length; i++)
+ GetColumn (i);
+ }
public
#if NET_2_0
libodbc.SQLNumResultCols (hstmt, ref colcount);
cols = new OdbcColumn [colcount];
_dataTableSchema = null; // force fresh creation
- GetSchemaTable ();
+ GetColumns ();
}
return (ret == OdbcReturn.Success);
}