X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem.Data%2FSystem.Data.Common%2FDataColumnMapping.cs;h=c5a68d01057df7c3ebd44bca2983491c4c5b3d1f;hb=3fd4901a235bda0019f03317f4ee083744195758;hp=974e1fc43a28bc3fcc5760e9e74070b7f6db0a2f;hpb=1c14f1ee6d701510c15499d71fc2b324151a8629;p=mono.git diff --git a/mcs/class/System.Data/System.Data.Common/DataColumnMapping.cs b/mcs/class/System.Data/System.Data.Common/DataColumnMapping.cs index 974e1fc43a2..c5a68d01057 100644 --- a/mcs/class/System.Data/System.Data.Common/DataColumnMapping.cs +++ b/mcs/class/System.Data/System.Data.Common/DataColumnMapping.cs @@ -36,7 +36,11 @@ using System.ComponentModel; using System.Data; namespace System.Data.Common { +#if NET_2_0 + [TypeConverterAttribute ("System.Data.Common.DataColumnMapping+DataColumnMappingConverter, " + Consts.AssemblySystem_Data)] +#else [TypeConverterAttribute (typeof (DataColumnMappingConverter))] +#endif public sealed class DataColumnMapping : MarshalByRefObject, IColumnMapping, ICloneable { #region Fields @@ -64,7 +68,7 @@ namespace System.Data.Common { #region Properties -#if !NET_2_0 +#if ONLY_1_1 [DataSysDescription ("DataColumn.ColumnName")] #endif [DefaultValue ("")] @@ -99,11 +103,16 @@ namespace System.Data.Common { } #if NET_2_0 - [MonoTODO] [EditorBrowsable (EditorBrowsableState.Advanced)] public static DataColumn GetDataColumnBySchemaAction (string sourceColumn, string dataSetColumn, DataTable dataTable, Type dataType, MissingSchemaAction schemaAction) { - throw new NotImplementedException (); + if (dataTable.Columns.Contains (dataSetColumn)) + return dataTable.Columns [dataSetColumn]; + if (schemaAction == MissingSchemaAction.Ignore) + return null; + if (schemaAction == MissingSchemaAction.Error) + throw new InvalidOperationException (String.Format ("Missing the DataColumn '{0}' in the DataTable '{1}' for the SourceColumn '{2}'", dataSetColumn, dataTable.TableName, sourceColumn)); + return new DataColumn (dataSetColumn, dataType); } #endif