3
我有類似下面的代碼,這個存儲過程'get2Rows'返回2行,我想獲取第1行並獲取列值,然後獲取第2行並獲取列值。我如何迭代?遍歷結果集.Net
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....
}
};
}