A
Amidan
We're using the above mentioned Application Block in our project, in
order to execute stored procedure (SQL-Server). One of the stored
procedures executes a list of simple "select" commands, e.g. select *
from tableX, select * from tableY etc.
I used a string array in order to name the tables that are selected
(TableMappings).
I used one of the SqlHelper.FillDataset() overloads to execute my
stored procedures, and to my surprise the table names were completely
mismatched. After a short debugging session, it turned out that the
code line :
tableName += (index + 1).ToString();
(line 1840, method signature: private static void
FillDataset(SqlConnection connection, SqlTransaction transaction,
CommandType commandType, string commandText, DataSet dataSet,
string[]tableNames, params SqlParameter[] commandParameters)
contains the bug. tableName starts as "Table", on the second pass
it'll be "Table1", and on the third pass it'll be "Table12"!!! when it
should be "Table3".
the code line should be something like:
tableName = "Table" + (index + 1).ToString();
This fixes the problem.
For your information,
Amidan Roth,
(e-mail address removed)
Log-On Software, Israel.
order to execute stored procedure (SQL-Server). One of the stored
procedures executes a list of simple "select" commands, e.g. select *
from tableX, select * from tableY etc.
I used a string array in order to name the tables that are selected
(TableMappings).
I used one of the SqlHelper.FillDataset() overloads to execute my
stored procedures, and to my surprise the table names were completely
mismatched. After a short debugging session, it turned out that the
code line :
tableName += (index + 1).ToString();
(line 1840, method signature: private static void
FillDataset(SqlConnection connection, SqlTransaction transaction,
CommandType commandType, string commandText, DataSet dataSet,
string[]tableNames, params SqlParameter[] commandParameters)
contains the bug. tableName starts as "Table", on the second pass
it'll be "Table1", and on the third pass it'll be "Table12"!!! when it
should be "Table3".
the code line should be something like:
tableName = "Table" + (index + 1).ToString();
This fixes the problem.
For your information,
Amidan Roth,
(e-mail address removed)
Log-On Software, Israel.