title: Insert data from one table to another using linQ
body: <p>I have two tables <code>Cart(ItemID, Name, Price, Quantity, CartID, CustID)</code> and <code>PP( invoiceID, itemID, orderQuantity, PricePerUnit, includesID)</code>. </p>
  
  <p>Now I have to insert values (<code>ItemID,  Price, Quantity</code>) from the <code>Cart</code> table into the <code>pp</code> table where <code>cart.custid = session[customerID]</code>. But the values not getting inserted into the <code>pp</code> table. Not sure if the <code>AsEnumerable</code> syntax used here is correct.</p>
  
  <pre><code>DataClassesDataContext context = new DataClassesDataContext();
  
  var Carts = context.Carts;
  pp newpp = new pp();
  
  var p = Carts.AsEnumerable().Select(x =&gt; new pp()
  {
      itemID = x.ItemID,
      PricePerUnit = Convert.ToDouble(x.Price),
      orderQuantity = x.Quantity,
      invoiceID = invoiceNum
  
  });
  
  context.pps.InsertAllOnSubmit(p);
  </code></pre>