For this particular case why have not you tried writing an SP that tailor your result in the defined fashion. The skeleton of SP could be like
SP Begin
SELECT IndexId, ValueofFunc(Index)
FROM TABLE
WHERE INDEXID BETWEEN 1 AND 19
SP END
Function ValueofFunc(Indx)
Begin
SELECT Data
FROM TABLE
WHERE INDEXID = Index
END
This will not only reduce your round trips but also reduce complexity of Business Layer code as all you have to do is bind the result to an array