Question : How can i solve "The query results cannot be enumarated more than once"

if i try to write below codes : error return to me: **The query results cannot be enumerated more than once**

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
public void StartTransaction()
        {
            using (var stockMovementCtx = new StockMovementCtxDataContext())
            using (var scope = new TransactionScope())
            {

                var stockMovementItems = from s in stockMovementCtx.spStockMovementForTransaction(TicketID, ItemTypeNo, ItemID, TransactionType,
                                                                                                  FromLocation, ToLocation, Qty, PersonelNo, cuser
                                                                                                  )
                                         select s;

                ReturnCode = stockMovementItems.First().ReturnCode;
               // MessageBox.Show(stockMovementItems.First().ToString());
                ReturnMsg = stockMovementItems.First().ReturnMessage;
                TransactionType = stockMovementItems.First().TransactionType;
                TicketID = stockMovementItems.First().TicketID;

Answer : How can i solve "The query results cannot be enumarated more than once"

what about:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
public void StartTransaction()
        {
            using (var stockMovementCtx = new StockMovementCtxDataContext())
            using (var scope = new TransactionScope())
            {

                var stockMovementItems = from s in stockMovementCtx.spStockMovementForTransaction(TicketID, ItemTypeNo, ItemID, TransactionType,
                                                                                                  FromLocation, ToLocation, Qty, PersonelNo, cuser
                                                                                                  )
                                         select s;

                ReturnCode = s.ReturnCode;
               // MessageBox.Show(stockMovementItems.First().ToString());
                ReturnMsg = s.ReturnMessage;
                TransactionType = s.TransactionType;
                TicketID = s.TicketID;
Random Solutions  
 
programming4us programming4us