title: Multiple Items From DataGridVirew Saving Problem
body: <p>I Have a form Called PurchaseInvoiceForm. It has many products when i add multiple product in DataGridView He Never Save All Items But it shows some error.I have a DLL which i created 
  to use for Data Save | Retrieve And Perform some other actions on it. Here is the following code which i used. </p>
  
  <p>This is the first thing when i click SaveButton.</p>
  
  <pre><code>private void SaveMetroTile_Click(object sender, EventArgs e)
      {
          if (IsFormOk())
          {
              if (this.IsUpdate)
              {
                  //Do Update Process
                  SaveOrUpdateStock("usp_PurchaseInvoiceSaveOrUpdateStockDetails");
                  ShowSucessMessage("Purchase Invoice Has Been Updated Successfully");
              }
              else
              {
                  //Do Save Process
                  SaveOrUpdateStock("usp_PurchaseInvoiceSaveOrUpdateStockDetails");
                  ShowSucessMessage("Purchase Invoice Has Been Added Successfully");
              }
  
          }
  
      }
  </code></pre>
  
  <p>This is the method that is used to save or update record it accepts Stored Procedure and object.</p>
  
  <pre><code>    private void SaveOrUpdateStock(string storedProceName)
      {
          DbSQLServer db = new DbSQLServer(AppSetting.ConnectionString());
          db.SaveOrUpdateRecord(storedProceName, GetObject());
      }
      private StockDetails GetObject()
      {
          StockDetails stock = new StockDetails();
          try
          {     
              stock.ProcessType = (this.IsUpdate) ? (int)ProcessType.Update : (int)ProcessType.Save;
              stock.PurchaseInvoiceId = (this.IsUpdate) ? this.Id : 0; //Zero Means No Id Just Save
              stock.PurchaseInvoiceNo = Convert.ToInt32(InvoiceNoMetroTextBox.Text.Trim());
              stock.PurchaseInvoiceDate = PurchaseInvoiceDateMetroDateTime.Value.Date;
  
              stock.InvoiceNo = Convert.ToInt32(PurchaseInvoiceNoMetroTextBox.Text.Trim());
              stock.InvoiceDate = PurchaseInvoiceDateMetroDateTime.Value.Date;
  
              stock.PartyId =Convert.ToInt32(PartyNameMetroComboBox.SelectedValue);
              stock.FromCity = Convert.ToInt32(FromCityMetroComboBox.SelectedValue);
              stock.ToCity = Convert.ToInt32(ToCityMetroComboBox.SelectedValue);
  
  
              foreach (DataGridViewRow row in PurchaseInvoiceMetroGrid.Rows)
              {   
                  stock.ProductName= row.Cells["ProductName"].Value.ToString();
                  stock.ProductCode = Convert.ToInt32(row.Cells["ProductCode"].Value);
                  stock.Box = Convert.ToDecimal(row.Cells["Box"].Value);
                  stock.Quantity = Convert.ToInt32(row.Cells["Quantity"].Value);
                  stock.UnitPrice = Convert.ToInt32(row.Cells["Price"].Value);
                  stock.DiscountInPercent = Convert.ToDecimal(row.Cells["DiscountInPercent"].Value);
                  stock.DiscountAmount = Convert.ToDecimal(row.Cells["DiscountAmount"].Value);
                  stock.Amount = Convert.ToDecimal(row.Cells["Amount"].Value);
              }
  
              stock.SubTotal =Convert.ToDecimal(SubTotalMetroTextBox.Text.Trim());
              stock.DiscountedAmount = Convert.ToDecimal(DiscountedAmountMetroTextBox.Text);
              stock.DiscountPercentage = Convert.ToDecimal(DiscountPercentageMetroTextBox.Text);
              stock.Tax = Convert.ToInt32(TaxMetroTextBox.Text.Trim());
              stock.Freight = Convert.ToInt32(FreightMetroTextBox.Text.Trim());
              stock.NetAmount = Convert.ToDecimal(NetAmountMetroTextBox.Text.Trim());
  
              stock.AllFreight =Convert.ToDecimal(AllFreightMetroTextBox.Text.Trim());
              stock.AllTax = Convert.ToDecimal(AllTaxMetroTextBox.Text.Trim());
  
              stock.DriverName = DriverNameMetroTextBox.Text.Trim();
              stock.Mobile = MobileMetroTextBox.Text.Trim();
              stock.Vehicle = VehicleNoMetroTextBox.Text.Trim();
              stock.Remarks = RemarksMetroTextBox.Text.Trim();
  
              stock.LastUpdatedBy = LoggedInUser.UserName;
              stock.CreatedBy = LoggedInUser.UserName;
  
          }
          catch(Exception ex)
          {
              ShowErrorMessage("Error : " + ex.Message);
          }
          return stock;
      }
  </code></pre>