Browse Source

[system.data] Update for DataSetExtensions as GetTableMappingBySchemaAction is now more restrictive.

Marek Safar 11 years ago
parent
commit
d0d5cd45de

+ 1 - 1
mcs/class/System.Data/ReferenceSources/Res.cs

@@ -94,7 +94,7 @@ static class Res
 	public const string ADP_InvalidSizeValue = "ADP_InvalidSizeValue";
 	public const string ADP_InvalidSourceBufferIndex = "ADP_InvalidSourceBufferIndex";
 	public const string ADP_InvalidSourceColumn = "ADP_InvalidSourceColumn";
-	public const string ADP_InvalidSourceTable = "ADP_InvalidSourceTable";
+	public const string ADP_InvalidSourceTable = "SourceTable is required to be a non-empty string";
 	public const string ADP_InvalidStartRecord = "ADP_InvalidStartRecord";
 	public const string ADP_InvalidUDL = "ADP_InvalidUDL";
 	public const string ADP_InvalidValue = "ADP_InvalidValue";

+ 1 - 1
mcs/class/System.Data/System.Data.Common/DataAdapter.cs

@@ -312,7 +312,7 @@ namespace System.Data.Common
 				//FIXME : The sourcetable name shud get passed as a parameter.. 
 				int index = dtMapping.IndexOfDataSetTable (table.TableName);
 				string srcTable = (index != -1 ? dtMapping[index].SourceTable : table.TableName);
-				tableMapping = DataTableMappingCollection.GetTableMappingBySchemaAction (dtMapping, srcTable, table.TableName, missingMapAction); 
+				tableMapping = DataTableMappingCollection.GetTableMappingBySchemaAction (dtMapping, ADP.IsEmpty (srcTable) ? " " : srcTable, table.TableName, missingMapAction); 
 				if (tableMapping != null) {
 					table.TableName = tableMapping.DataSetTable;
 					// check to see if the column mapping exists