我有如下代码,这个存储过程'get2Rows'返回2行,我想获取第一行并获取列值,然后是第二行并获取列值。我需要如何迭代?
using (System.Data.Common.DbCommand dbCommand = DataAccess.Instance().Database.GetStoredProcCommand("get2Rows"))
{
using (IDataReader reader = DataAccess.Instance().Database.ExecuteReader(dbCommand))
{
while (reader.Read())//here i want to get the 1st row
{
//here i want to get the columns of the 1st row....
}
};
}