title: How do I store data from an ObservableCollection into an SQL database?
body: <p>I have some records inside an ObservableCollection.</p>
  
  <pre><code>void proxy_AddPayNowOrderCompleted(object sender, AddPayNowOrderCompletedEventArgs e)
  {
      listBox1.ItemsSource = e.Result;
      ObservableCollection&lt;Product&gt; Products = this.listBox1.ItemsSource as ObservableCollection&lt;Product&gt;;
  }
  </code></pre>
  
  <p>My Product entity will have prodid, prodname, prodrice. There will be many of these entities inside the ObservableCollection. I want to save all the records in the ObservableCollection into my SQL database. I'm using this code to save one record into the database.</p>
  
  <pre><code>private void btn1_Click(object sender, RoutedEventArgs e)
  {
      proxy.AddPayNowOrderCompleted += new EventHandler&lt;AddPayNowOrderCompletedEventArgs&gt;(proxy_AddPayNowOrderCompleted);
      proxy.AddPayNowOrderAsync(orderdate, prodid, orderprodname, orderprice, orderstatus, custemail, paymentdate);
  }
  </code></pre>
  
  <p>How can I store all of the records inside the ObservableCollection and insert them into the database?</p>