Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSureshkumar T <suresh@mono-cvs.ximian.com>2005-04-27 16:39:14 +0400
committerSureshkumar T <suresh@mono-cvs.ximian.com>2005-04-27 16:39:14 +0400
commit795c6d2a23c7aa80045be74da9ee73a3203cd222 (patch)
treeca704f901240690aa150532d5bad96a981d4d57b /mcs/class/System.Data/System.Data.Common
parent3a39ac2b4aa9fb0da2b69026d879c8e649320cb7 (diff)
2005-04-27 Sureshkumar T <tsureshkumar@novell.com>
* System.Data/DataTableReader.cs: Implemented most of the TODO. * Test/System.Data/DataTableReaderTest.cs: Added Tests for DataTableReader class. * System.Data.Common/DbDataReader.cs: Added static method to construct the schema table with default schema. Could be reused in many places. * System.Data_test.dll.sources: Added DataTableReaderTest.cs svn path=/trunk/mcs/; revision=43650
Diffstat (limited to 'mcs/class/System.Data/System.Data.Common')
-rwxr-xr-xmcs/class/System.Data/System.Data.Common/ChangeLog5
-rw-r--r--mcs/class/System.Data/System.Data.Common/DbDataReader.cs36
2 files changed, 41 insertions, 0 deletions
diff --git a/mcs/class/System.Data/System.Data.Common/ChangeLog b/mcs/class/System.Data/System.Data.Common/ChangeLog
index c0ee834b35b..b145a8ff962 100755
--- a/mcs/class/System.Data/System.Data.Common/ChangeLog
+++ b/mcs/class/System.Data/System.Data.Common/ChangeLog
@@ -1,3 +1,8 @@
+2005-04-27 Sureshkumar T <tsureshkumar@novell.com>
+
+ * DbDataReader.cs: Added static method to construct the schema
+ table with default schema. Could be reused in many places.
+
2005-04-22 Sureshkumar T <tsureshkumar@novell.com>
* DbDataAdapter.cs: Moved FillTable and BuildSchema as static
diff --git a/mcs/class/System.Data/System.Data.Common/DbDataReader.cs b/mcs/class/System.Data/System.Data.Common/DbDataReader.cs
index ba0d2fab0c5..6dd3f1733cb 100644
--- a/mcs/class/System.Data/System.Data.Common/DbDataReader.cs
+++ b/mcs/class/System.Data/System.Data.Common/DbDataReader.cs
@@ -105,6 +105,42 @@ namespace System.Data.Common {
public abstract bool NextResult ();
public abstract bool Read ();
+ 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");
+
+ 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);
+
+ return schemaTable;
+ }
+
#endregion // Methods
}
}