Issues with DGV Columns after converting to MongoDB

Hello all,

I am trying to create a nested collection of orders on MongoDB. I have successfully inserted and read data from mongo. However I am having issues with nested data.

Below is the structure of my classes.

public class OrderItem

        public string Type { get; set; }

        public string Vendor { get; set; }

        public string Description { get; set; }

        public double Cost { get; set; }

        [BsonElement("Order Qty")]
        public int OrderQty { get; set; }

        public int Serial { get; set; }

        public string PID { get; set; }
    public class OrderList
        public List<OrderItem> OrderItemList { get; set; }

        public string Po { get; set; }

        [BsonElement("Order Total")]
        public double OrderTotal { get; set; }

        public DateTime OrderDate { get; set; }


and then below is the implementation. i get a object reference not set to an instance of an object as the error.

OrderList order = new OrderList();
                                OrderItem item = new OrderItem();
                                foreach (DataGridViewRow row in DGV_orders.Rows)
                                    foreach (DataGridViewCell cell in row.Cells)
                                    item.Description = Convert.ToString(row.Cells["Description"].Value);
                                    item.Vendor = Convert.ToString(row.Cells["Vendor"].Value);
                                    item.Cost = Convert.ToDouble(row.Cells["Cost"].Value);
                                    item.OrderQty = Convert.ToInt32(row.Cells["OrderQty"].Value);
                                    item.Type = Convert.ToString(row.Cells["Type"].Value);
                                    item.PID = Convert.ToString(row.Cells["ProductId"].Value);
                                    item.Serial = Convert.ToInt32(row.Cells["ProductLink"].Value);

                                    double cost = Convert.ToDouble(row.Cells[1].Value);
                                    double qty = Convert.ToDouble(row.Cells[2].Value);
                                    double lineTotal = cost * qty;
                                    sum += lineTotal;
                                order.OrderTotal = Math.Round(sum, 2);
                                order.OrderDate = DateTime.Today;
                                order.Po = orderPO.Text;


does anyone have any helpful ideas what i’m doing wrong?

What i’m going for is a list of orders, with each order containing a total, a data, a PO, and then a list of items on the order. I think i’m very close but no luck yet.