So I have a pretty simple reader, which executes given query:
connection.Open();
using (var r = command.ExecuteReader())
{
while (r.Read())
{
foreach (var item in r)
{
var listOfValues = (System.Data.Common.DbDataRecord)item;
result.Add(VisualTsTableMapper.MapFromDbRecord(listOfValues));
}
};
}
connection.Close();
As from database, I am getting 4 rows of results. Although after reading I retrieve only 3. What do I do wrong?


.Read()(or better yet, eliminate this boilerplate altogether and use Dapper). Enumeration implicitly starts off with a.Read(), so you're discarding the first row.CommandType.StoredProcedure, apparently); useSELECT/CALLas appropriate.