#28 MockDataReader.findColumnIndexForName doesn't work

open
nobody
None
5
2013-01-10
2005-10-30
Anonymous
No

MockDataReader.cs, lines 516-522 currently read

for (int i = 0; i < _schemaTable.Columns.Count; ++i) {
if (_schemaTable.Columns[i].ColumnName.Equals(name))
{
return i;
}
}

They should read:

for (int i = 0; i < _schemaTable.Rows.Count; ++i) {
if (_schemaTable.Rows[i]["ColumnName"].Equals(name))
{
return i;
}
}

Since schema tables store data about each column
returned in an IDataReader as a separate row of data
(per the MSDN documentation on IDataReader).

Thanks,
Matt (matthinz@nospamgmail.com, minus no spam)

Discussion


Log in to post a comment.