tableMappings in the FillDataSet() overload with the following signature:
private static void FillDataset(Sql Connection connection, SqlTransaction
transaction,
CommandType commandType, string commandText, DataSet dataSet,
string[] tableNames, params SqlParameter[] commandParamete rs)
{
}
The code in question is line 1840 (C#), which reads:
tableName += (index + 1).ToString();
Assuming the following string:
string tableNames = {"MyTable1", "MyTable2", "MyTable3", "MyTable4" };
this original statement will produce:
dataAdapter.Tab leMappings.Add( "Table" , "MyTable1") ;
dataAdapter.Tab leMappings.Add( "Table1" , "MyTable2") ;
dataAdapter.Tab leMappings.Add( "Table12" , "MyTable3") ;
dataAdapter.Tab leMappings.Add( "Table123" , "MyTable4") ;
This is incorrect. It should be:
dataAdapter.Tab leMappings.Add( "Table" , "MyTable1") ;
dataAdapter.Tab leMappings.Add( "Table1" , "MyTable2") ;
dataAdapter.Tab leMappings.Add( "Table2" , "MyTable3") ;
dataAdapter.Tab leMappings.Add( "Table3" , "MyTable4") ;
FIX: The corrected version of this line (for reference: line 1840):
tableName = tableName + (index + 1).ToString();
NOTE that the VB.NET version is correct, with this string:
tableName = tableName & (index + 1).ToString()
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
*************** *************** *************** *************** **********
Think Outside the Box!
*************** *************** *************** *************** **********