Using Entity Framework in an ASP.NET MVC5 Application

In my previous two posts, I built a C# console application using Entity Framework (EF) in Microsoft Visual Studio 2013, and investigated how to perform CRUD operations on EF.

Building an ASP.NET MVC5 application using EF can become a straightforward job in Visual Studio 2013. It is very similar to building a J2EE MVC application by using JPA in Netbeans 7. The steps can be summarized as three steps: 1) create a ASP.NET MVC project; 2) add M: reversed engineer an EF model(M) from database; 3) Add C with V: scaffolding MVC 5 Controller (C) with views (V) using EF.

1. Create a ASP.NET MVC Project

In Microsoft Visual Studio 2013, create a new project (Ctrl-Shift-N) called EmployeeMVC using template (Visual C#->ASP.NET Web Application) and also select a template ‘MVC‘ and add folders and core references for ‘MVC’.

What will happene?
Visual Studio will create a few folders (App_Data, App_Start, Content, Controllers, fonts, Models, Scripts, Views) and files (Global.asax, packages.config, Web.config, Project_Readme.html, Startup.cs), also download a list of js scripts in Scripts folder, create AccountViewModels.cs and IdentityModels.cs in Models folder, AccountController.cs and HomeController.cs in Controllers folder, a list of *.shtml in various view folders, site style sheets in Contents folder and a few config.cs in App_Start.

Press F5 to build and run the empty application now.

2. Add ADO.NET Entity Data Model

Following the steps to reversed engineer EF 5 model from a table in the database into ASP.NET MVC (for reversed engineer an EF 6 model class, please use Entity Framework Power Tools):

  • Right click on Models folder, and choose New Item-Add->Data->ADO.NET Entity Data Model (C#);
  • Provide a Name: EmployeeModel.edmx and Click ‘Add’;
  • Choose ‘generate from database’ and Click ‘Next’
  • Connect to a SQL instance (local), choose your database (test) and table (HR.Employee)
  • If you receive a security warning, select OK to continue running the template.
  • This will add EmployeeModel.edmx (EF 5) as a folder under Models, and also add relevant references.

    Build the solution.

    3. Generate Controller and Views

    To generate controller and views:

  • Add the new controller to the existing Controllers folder. Right-click the Controllers folder, and select Add – New Scaffolded Item; Select the MVC 5 Controller with views, using Entity Framework option. This option will generate the controller and views for updating, deleting, creating and displaying the data in your model.
  • Set the controller name to EmployeeController, select Employee (EmployeeMVC.Models) for the model class, and select the testEntities (EmployeeMVC.Models) for the context class, Click ‘Add’
  • This will create EmployeeController.cs in Controllers:

    using System;
    using System.Collections.Generic;
    using System.Data;
    using System.Data.Entity;
    using System.Linq;
    using System.Net;
    using System.Web;
    using System.Web.Mvc;
    using EmployeeMVC.Models;
    
    namespace EmployeeMVC.Controllers
    {
        public class EmployeeController : Controller
        {
            private testEntities db = new testEntities();
    
            // GET: /Employee/
            public ActionResult Index()
            {
                var employees = db.Employees.Include(e => e.Employee1);
                return View(employees.ToList());
            }
    
            // GET: /Employee/Details/5
            public ActionResult Details(int? id)
            {
                if (id == null)
                {
                    return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
                }
                Employee employee = db.Employees.Find(id);
                if (employee == null)
                {
                    return HttpNotFound();
                }
                return View(employee);
            }
    
            // GET: /Employee/Create
            public ActionResult Create()
            {
                ViewBag.mgrid = new SelectList(db.Employees, "empid", "lastname");
                return View();
            }
    
            // POST: /Employee/Create
            // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
            // more details see http://go.microsoft.com/fwlink/?LinkId=317598.
            [HttpPost]
            [ValidateAntiForgeryToken]
            public ActionResult Create([Bind(Include="empid,lastname,firstname,title,titleofcourtesy,birthdate,hiredate,address,city,region,postalcode,country,phone,mgrid")] Employee employee)
            {
                if (ModelState.IsValid)
                {
                    db.Employees.Add(employee);
                    db.SaveChanges();
                    return RedirectToAction("Index");
                }
    
                ViewBag.mgrid = new SelectList(db.Employees, "empid", "lastname", employee.mgrid);
                return View(employee);
            }
    
            // GET: /Employee/Edit/5
            public ActionResult Edit(int? id)
            {
                if (id == null)
                {
                    return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
                }
                Employee employee = db.Employees.Find(id);
                if (employee == null)
                {
                    return HttpNotFound();
                }
                ViewBag.mgrid = new SelectList(db.Employees, "empid", "lastname", employee.mgrid);
                return View(employee);
            }
    
            // POST: /Employee/Edit/5
            // To protect from overposting attacks, please enable the specific properties you want to bind to, for 
            // more details see http://go.microsoft.com/fwlink/?LinkId=317598.
            [HttpPost]
            [ValidateAntiForgeryToken]
            public ActionResult Edit([Bind(Include="empid,lastname,firstname,title,titleofcourtesy,birthdate,hiredate,address,city,region,postalcode,country,phone,mgrid")] Employee employee)
            {
                if (ModelState.IsValid)
                {
                    db.Entry(employee).State = EntityState.Modified;
                    db.SaveChanges();
                    return RedirectToAction("Index");
                }
                ViewBag.mgrid = new SelectList(db.Employees, "empid", "lastname", employee.mgrid);
                return View(employee);
            }
    
            // GET: /Employee/Delete/5
            public ActionResult Delete(int? id)
            {
                if (id == null)
                {
                    return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
                }
                Employee employee = db.Employees.Find(id);
                if (employee == null)
                {
                    return HttpNotFound();
                }
                return View(employee);
            }
    
            // POST: /Employee/Delete/5
            [HttpPost, ActionName("Delete")]
            [ValidateAntiForgeryToken]
            public ActionResult DeleteConfirmed(int id)
            {
                Employee employee = db.Employees.Find(id);
                db.Employees.Remove(employee);
                db.SaveChanges();
                return RedirectToAction("Index");
            }
    
            protected override void Dispose(bool disposing)
            {
                if (disposing)
                {
                    db.Dispose();
                }
                base.Dispose(disposing);
            }
        }
    }
    
    

    It will also create a folder ‘Employee‘ in Views with a list of cshtml (Create, Delete, Details, Edit, Index)

    Build and run by pressing F5, and go to the similar link in the browser like:
    http://localhost:49481/employee

    I removed some of unwanted items in index.cshtml. My index page looked like:

    ASP.NET MVC 5 using EF

    ASP.NET MVC 5 using EF

    Summary

    Using Entity Framework, Visual Studio 2013 can easily generate a model from database, and scaffold a controller and generate all the views based on default templates and standard CRUD operations on EF.

    The advantage of this process is that the model, controller and view can be easily re-generated by repeating the above step 2 and 3 if the table structure in the underlying physical table is changed.

    The disadvantage is also obvious. Whatever customization made after the generation on (M. V. C) will have to be repeated after re-generation.

    Working With Model in Entity Framework

    In the previous post, I showed how to reversed-engineer an entity framework model from a Microsoft SQL Server 2012 database, and query the model in a C# console program. In the following, I will expand it further on how to work on the model generated to perform the standard CRUD (Create, Read, Update, Delete) operations.

    Model

    The model generated in the last post was in a file (testContext.cs) where the database context (testContext) was derived from DbContext, in which the property Employees was exposed as an entity (DbSet). In the simple RDBMS terms, the physical database (test) is mapped to DbContext (testContext) while a physical table (employees) was mapped to an entity DbSet (Employees). The entity model is like a conceptual model in the database design process.

    Little notes on database design process
    In a normal database design process, we design a conceptual model first by using designer like Visual Studio EF Designer or Oracle SQL developer/modeler, which will produce an ER-Diagram (Entity-Relationship Diagram) as a result. From the model, we can generate the physical model which is a set of DDLs, to run on a specific RDBMS like Oracle, MS SQL Server, etc. and produce a database.

    In our previous example, we reversed the design process from bottom up, and generated the conceptual model into Entity Framework in Visual Studio from the physical database structures in Microsoft SQL Server (Database: test; Table: HR.Employees). This process is called reversed engineering.

    namespace EmployeeConsole.Models
    {
        public partial class testContext : DbContext
        {
            ......
            public DbSet<Employee> Employees { get; set; }
            ......
        }
    }
    

    Work on Model

    To work on the model, the first is to include your model, then instantiate a dbContext so that the CRUD ops can be performed within the instance lifetime.

    Here is the code snippets. Refer to last post for details.

    using EmployeeConsole.Models;
    ...
          using (var db = new testContext())
              {
                 // TODO YOUR CRUD Ops
              }
    

    How to Read (Find) a Record

                using (var db = new testContext())
                {
    
                    var myemp = db.Employees.Find(3);
                    Console.WriteLine("Locate and Display empid=3");
                    Console.WriteLine("EmpID\t{0}",myemp.empid);
                    Console.WriteLine("FName\t{0}", myemp.firstname);
                    Console.WriteLine("LName\t{0}", myemp.lastname);
                    Console.WriteLine("HDate\t{0}", myemp.hiredate);
                    Console.WriteLine("Phone\t{0}", myemp.phone);
                    Console.WriteLine("Country\t{0}", myemp.country);
                    Console.WriteLine("Press any key to exit...");
                    Console.ReadKey();
                }
    

    How to Update a Record

                using (var db = new testContext())
                {
    
                    // Find the record first
                    var myemp = db.Employees.Find(3);
                    Console.WriteLine("EmpID\t{0}",myemp.empid);
                    Console.WriteLine("Firstname\t{0}", myemp.firstname);
                    Console.WriteLine("Lastname\t{0}", myemp.lastname);
    
                    // Update DbSet in memory
                    myemp.lastname = "Smith";
    
                    // Write to db
                    db.SaveChanges();
                    
                    // db.SaveChanges is the same as the following RAW T-SQL
                    //db.Database.ExecuteSqlCommand("update hr.employees set lastname='Smith' where empid=3");
    
                    Console.WriteLine("Press any key to exit...");
                    Console.ReadKey();
                }
    

    How to Add a New Record

                using (var db = new testContext())
                {
                    var newemp = new Employee();
                    newemp.firstname = "Adam";
                    newemp.lastname = "Smith";
                    newemp.title="Economist";
                    newemp.titleofcourtesy="";
                    newemp.birthdate=Convert.ToDateTime("01/01/1980");
                    newemp.hiredate=Convert.ToDateTime("01/01/2001");
                    newemp.address="16 Bay Street";
                    newemp.city="Toronto";
                    newemp.region="Mr.";
                    newemp.postalcode="B2C 2V7";
                    newemp.country="CANADA";
                    newemp.phone="(416) 822-2288";
    
                    // Add to DbSet
                    db.Employees.Add(newemp);
                    // Write to db
                    db.SaveChanges();
    
                    // db.SaveChanges is the same as the following RAW T-SQL
                    //db.Database.ExecuteSqlCommand("insert into hr.employees (..) values (...)");
    
                    Console.WriteLine("Press any key to exit...");
                    Console.ReadKey();
                }
    

    How to Delete a Record

                using (var db = new testContext())
                {
                    // identify the record first, (empid=10) is the new record inserted in last code snippet.
                    var empToBeDeleted=db.Employees.Find(10);
    
                    // remove from DbSet
                    db.Employees.Remove(empToBeDeleted);
    
                    // Write to db
                    db.SaveChanges();
    
                    // db.SaveChanges is the same as the following RAW T-SQL
                    //db.Database.ExecuteSqlCommand("delete from hr.employees where empid=10");
    
                    Console.WriteLine("Press any key to exit...");
                    Console.ReadKey();
                }
    

    Further Reading

  • Working with Entity Data from MSDN
  • Working with Objects
  • Working with Data (Entity Framework Tutorial)
  • Reading XML with the XmlReader in Powershell

    The XmlReader class in .Net Framework reads XML data from a stream or file. It provides non-cached, forward-only, read-only access to XML data. I wrote a simple program in powershell to explore XmlReader class as belows. Have fun!

    A sample XML input file: books.xml

    <?xml version="1.0"?>
    <books>
     <book> 
       <author>Carson</author>
       <price>31.95</price>
       <pubdate>05/01/2001</pubdate>
     </book>
     <pubinfo>
       <publisher>MSPress</publisher>
       <state>WA</state>
     </pubinfo>
    </books>

    A powershell script: xmlreader1.ps1

    ##  
    # xmlreader1.ps1  
    ## 
    $PWD=Get-Location
    $xmlfile=$PWD.Path+"\books.xml"
    
    # Create XML Reader  
    $reader = [system.Xml.XmlReader]::Create($xmlfile) 
    
    # Parse the XML document.  
    $result=$reader.Read()  
    $reader.ReadStartElement("books")
    
    # start book node
    "The following is from book:"
    $reader.ReadStartElement("book")
    
    # Read and Display auther  
    $reader.ReadStartElement("author")     
    "author: {0}" -f $reader.ReadString()  
    $reader.ReadEndElement()  
    
    # Read and display price  
    $reader.ReadStartElement("price")  
    "price: {0}" -f $reader.ReadString()  
    $reader.ReadEndElement() 
    # Read and display pubdate
    $reader.ReadStartElement("pubdate")  
    "pubdate: {0}" -f $reader.ReadString()  
    $reader.ReadEndElement()
    
    # end book node
    ""
    $reader.ReadEndElement()
    
    # start pubinfo node
    "The following is from pubinfo:"
    $reader.ReadStartElement("pubinfo")
    
    # Read and Display publisher  
    $reader.ReadStartElement("publisher")     
    "publisher: {0}" -f $reader.ReadString()  
    $reader.ReadEndElement()  
    
    # Read and display state  
    $reader.ReadStartElement("state")  
    "state: {0}" -f 
    $reader.ReadString()  
    
    $reader.ReadEndElement() 
    # end pubinfo node
    
    $reader.ReadEndElement()
    # End of Script 

    Execution Result

    PS C:\henry416\> .\xmlreader1.ps1
    
    The following is from book:
    author: Carson
    price: 31.95
    pubdate: 05/01/2001
    
    The following is from pubinfo:
    publisher: MSPress
    state: WA

    What exactly is ADO.NET?

    ADO.NET consists of the following assemblies (On my machine, they locate in C:\WINNT\Microsoft.NET\assembly)

    System.Data.dll
    System.Data.OracleClient.dll
    System.Data.DataSetExtensions.dll
    System.Data.Design.dll
    System.Data.SqlXml.dll
    System.Data.Linq.dll
    System.Data.SqlServerCe.dll

    ADO.NET Offline DataTable Application

    The following is an ADO.NET application using a windows form template in Visual Studio 2008. The program manipulates a DataTable which is not connected to any external DataSet.

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    
    namespace ADOWindowsForm
    {
        public partial class Form1 : Form
        {
            DataTable tblCustomer = new DataTable();
            DataTable tblFoodPrice = new DataTable();
            DataTable tblComboBoxSelectWherePrice = new DataTable();
    
            DataSet set = new DataSet("Set");
    
            public Form1()
            {
                set.Tables.Add(tblCustomer);
                set.Tables.Add(tblFoodPrice);
    
                tblCustomer.TableName = "tblCustomer";
                tblFoodPrice.TableName = "tblFoodPrice";
    
                tblCustomer.Columns.Add("ID", typeof(long));
                tblCustomer.PrimaryKey = new DataColumn[] {tblCustomer.Columns["ID"]};
                tblCustomer.Columns["ID"].AutoIncrement = true;
                tblCustomer.Columns["ID"].AutoIncrementSeed = 1;
                tblCustomer.Columns["ID"].AllowDBNull = false;
                tblCustomer.Columns.Add("Name", typeof(string));
                tblCustomer.Columns.Add("Order", typeof(string)); 
                tblCustomer.Columns.Add("OrderID", typeof(long));
                tblCustomer.Columns["OrderID"].AllowDBNull = false;
                tblCustomer.Columns.Add("Price", typeof(double));
    
                tblFoodPrice.Columns.Add("ID", typeof(long));
                tblFoodPrice.PrimaryKey = new DataColumn[] { tblFoodPrice.Columns["ID"] };
                tblFoodPrice.Columns["ID"].AutoIncrement = true;
                tblFoodPrice.Columns["ID"].AutoIncrementSeed = 1;
                tblFoodPrice.Columns["ID"].AllowDBNull = false;
                tblFoodPrice.Columns.Add("Food", typeof(string));
                tblFoodPrice.Columns.Add("Price", typeof(double));
    
                tblComboBoxSelectWherePrice.Columns.Add("Condition", typeof(string));
    
                DataRelation foodID = new DataRelation("FoodID", tblFoodPrice.Columns["ID"], tblCustomer.Columns["OrderID"]);
                set.Relations.Add(foodID);
                tblCustomer.Columns["Order"].Expression = "Parent(FoodID).Food";
                tblCustomer.Columns["Price"].Expression = "Parent(FoodID).Price";
    
                tblFoodPrice.Rows.Add(new Object[] {null, "Fish", 10.00});
                tblFoodPrice.Rows.Add(new Object[] { null, "Couch Potato", 5.00 });
                tblFoodPrice.Rows.Add(new Object[] { null, "Head Cheese", 2.50 });
                tblFoodPrice.Rows.Add(new Object[] { null, "Whoopie Pie", 4.50 });
                tblFoodPrice.Rows.Add(new Object[] { null, "Spotted Dick", 11.50 });
                tblFoodPrice.Rows.Add(new Object[] { null, "WOMBO COMBO", 9.99 });
    
                tblCustomer.Rows.Add(new Object[] { null, "Customer A", null, 1 });
                tblCustomer.Rows.Add(new Object[] { null, "John Smith", null, 1 });
                tblCustomer.Rows.Add(new Object[] { null, "Gabe", null, 2 });
                tblCustomer.Rows.Add(new Object[] { null, "Ramirez", null, 3 });
                tblCustomer.Rows.Add(new Object[] { null, "Sir Woodsworth", null, 4});
                tblCustomer.Rows.Add(new Object[] { null, "Stereotype A", null, 5 });
                tblCustomer.Rows.Add(new Object[] { null, "John Smith", null, 2 });
    
                tblComboBoxSelectWherePrice.Rows.Add(new Object[] { "Equal To" });
                tblComboBoxSelectWherePrice.Rows.Add(new Object[] { "Less Than" });
                tblComboBoxSelectWherePrice.Rows.Add(new Object[] { "Greater Than" });
                tblComboBoxSelectWherePrice.Rows.Add(new Object[] { "Less Than or Equal To" });
                tblComboBoxSelectWherePrice.Rows.Add(new Object[] { "Greater Than or Equal To" });
    
                InitializeComponent();
    
                comboBoxSelectWherePrice.DataSource = tblComboBoxSelectWherePrice;
                comboBoxSelectWherePrice.DisplayMember = "Condition";
    
                DataTable addRowsCustomer = new DataTable();
                addRowsCustomer.Columns.Add("Name", typeof(string));
                addRowsCustomer.Columns.Add("OrderID", typeof(long));
                dataGridViewAddRowsCustomer.DataSource = addRowsCustomer;
    
                DataTable addRowsFood = new DataTable();
                addRowsFood.Columns.Add("Food", typeof(string));
                addRowsFood.Columns.Add("Price", typeof(double));
                dataGridViewAddRowsFood.DataSource = addRowsFood; 
    
                dataGridView1.AllowUserToAddRows = false;
    
                btnShowCustomerTable_Click(null, null);
            }
    
            private void btnShowCustomerTable_Click(object sender, EventArgs e)
            {
                /*listBox1.DataSource = tblCustomer;
                listBox1.DisplayMember = "ID";
                listBox1.Refresh();*/
    
                dataGridView1.DataSource = null;
                dataGridView1.DataSource = tblCustomer;
                dataGridView1.Columns["Price"].DefaultCellStyle.Format = "c";
                listBox1.Text = "Now showing from table: tblCustomer";
                dataGridView1.Refresh();
            }
    
            private void btnShowFoodTable_Click(object sender, EventArgs e)
            {
                /*listBox1.DataSource = tblFoodPrice;
                listBox1.DisplayMember = "ID";
                listBox1.Refresh();*/
    
                dataGridView1.DataSource = null;
                dataGridView1.DataSource = tblFoodPrice;
                dataGridView1.Columns["Price"].DefaultCellStyle.Format = "c";
                listBox1.Text = "Now showing from table: tblFoodPrice";
                dataGridView1.Refresh();
            }
    
            private void btnAddRowCustomer_Click(object sender, EventArgs e)
            {
                try
                {
                    btnShowCustomerTable_Click(null, null);
                    tblCustomer.Rows.Add(new Object[] { null, textBoxName.Text, null, Convert.ToInt64(textBoxOrder.Text), null });
                    dataGridView1.Refresh();
                }
                catch (Exception ex)
                {
                    listBox1.Text = ex.Message;
                    listBox1.Refresh();
                }
                textBoxName.Text = null;
                textBoxOrder.Text = null;
            }
    
            private void btnAddRowsCustomer_Click(object sender, EventArgs e)
            {
                try
                {
                    btnShowCustomerTable_Click(null, null);
                    for (int i = 0; i &lt; dataGridViewAddRowsCustomer.RowCount-1; i++)
                    {
                        tblCustomer.Rows.Add(new Object[] { null, dataGridViewAddRowsCustomer.Rows[i].Cells[0].Value, null, dataGridViewAddRowsCustomer.Rows[i].Cells[1].Value });
                    }
                    dataGridViewAddRowsCustomer.DataSource = null;
                    DataTable addRowsCustomer = new DataTable();
                    addRowsCustomer.Columns.Add("Food", typeof(string));
                    addRowsCustomer.Columns.Add("Price", typeof(long));
                    dataGridViewAddRowsCustomer.DataSource = addRowsCustomer; 
                }
                catch (Exception ex)
                {
                    listBox1.Text = ex.Message;
                }
            }
    
            private void btnAddRowFood_Click(object sender, EventArgs e)
            {
                try
                {
                    btnShowFoodTable_Click(null, null);
                    tblFoodPrice.Rows.Add(new Object[] { null, txtboxNewFoodName.Text, Convert.ToDouble(txtBoxNewFoodPrice.Text)});
                    dataGridView1.Refresh();
                }
                catch (Exception ex)
                {
                    listBox1.Text = ex.Message;
                    listBox1.Refresh();
                }
                txtboxNewFoodName.Text = null;
                txtBoxNewFoodPrice.Text = null;
            }
    
            private void btnAddRowsFood_Click(object sender, EventArgs e)
            {
                try
                {
                    btnShowFoodTable_Click(null, null);
                    for (int i = 0; i &lt; dataGridViewAddRowsFood.RowCount - 1; i++)
                    {
                        tblFoodPrice.Rows.Add(new Object[] { null, dataGridViewAddRowsFood.Rows[i].Cells[0].Value, dataGridViewAddRowsFood.Rows[i].Cells[1].Value });
                    }
                    dataGridViewAddRowsFood.DataSource = null;
                    DataTable addRowsFood = new DataTable();
                    addRowsFood.Columns.Add("Name", typeof(string));
                    addRowsFood.Columns.Add("Price", typeof(double));
                    dataGridViewAddRowsFood.DataSource = addRowsFood;
                }
                catch (Exception ex)
                {
                    listBox1.Text = ex.Message;
                }
            }
    
            private void btnSelectCustomerWhereID_Click(object sender, EventArgs e)
            {
                try
                {
                    DataRow[] matchingRows = tblCustomer.Select("ID = " + textBoxSelectCustomerWhereID.Text);
                    dataGridView1.DataSource = null;
                    DataTable tableForSelectedRows = matchingRows.CopyToDataTable();
                    dataGridView1.DataSource = tableForSelectedRows;
                    dataGridView1.Columns["Price"].DefaultCellStyle.Format = "c";
                    dataGridView1.Refresh();
                }
                catch (Exception ex)
                {
                    listBox1.Text = ex.Message;
                    listBox1.Refresh();
                }
                textBoxSelectCustomerWhereID.Text = null;
            }
    
            private void btnSelectCustomerWhereOrder_Click(object sender, EventArgs e)
            {
                try
                {
                    DataRow[] matchingRows = tblCustomer.Select("Order = '" + textBoxSelectCustomerWhereOrder.Text + "'");
                    dataGridView1.DataSource = null;
                    DataTable tableForSelectedRows = matchingRows.CopyToDataTable();
                    dataGridView1.DataSource = tableForSelectedRows;
                    dataGridView1.Columns["Price"].DefaultCellStyle.Format = "c";
                    dataGridView1.Refresh();
                }
                catch (Exception ex)
                {
                    listBox1.Text = ex.Message;
                    listBox1.Refresh();
                }
                textBoxSelectCustomerWhereOrder.Text = null;
            }
    
            private void btnSelectCustomerWhereOrderID_Click(object sender, EventArgs e)
            {
                try
                {
                    DataRow[] matchingRows = tblCustomer.Select("OrderID = " + textBoxSelectCustomerWhereOrderID.Text);
                    dataGridView1.DataSource = null;
                    DataTable tableForSelectedRows = matchingRows.CopyToDataTable();
                    dataGridView1.DataSource = tableForSelectedRows;
                    dataGridView1.Columns["Price"].DefaultCellStyle.Format = "c";
                    dataGridView1.Refresh();
                }
                catch (Exception ex)
                {
                    listBox1.Text = ex.Message;
                    listBox1.Refresh();
                }
                textBoxSelectCustomerWhereOrderID.Text = null;
            }
    
            private void btnSelectCustomerWhereCustomer_Click(object sender, EventArgs e)
            {
                try
                {
                    DataRow[] matchingRows = tblCustomer.Select("Name = '" + textBoxSelectCustomerWhereCustomer.Text + "'");
                    dataGridView1.DataSource = null;
                    DataTable tableForSelectedRows = matchingRows.CopyToDataTable();
                    dataGridView1.DataSource = tableForSelectedRows;
                    dataGridView1.Columns["Price"].DefaultCellStyle.Format = "c";
                    dataGridView1.Refresh();
                }
                catch (Exception ex)
                {
                    listBox1.Text = ex.Message;
                    listBox1.Refresh();
                }
                textBoxSelectCustomerWhereCustomer.Text = null;
            }
    
            private void btnSelectFoodWhereID_Click(object sender, EventArgs e)
            {
                try
                {
                    DataRow[] matchingRows = tblFoodPrice.Select("ID = " + txtBoxSelectFoodWhereID.Text );
                    dataGridView1.DataSource = null;
                    DataTable tableForSelectedRows = matchingRows.CopyToDataTable();
                    dataGridView1.DataSource = tableForSelectedRows;
                    dataGridView1.Columns["Price"].DefaultCellStyle.Format = "c";
                    dataGridView1.Refresh();
                }
                catch (Exception ex)
                {
                    listBox1.Text = ex.Message;
                    listBox1.Refresh();
                }
                txtBoxSelectFoodWhereID.Text = null;
            }
    
            private void SelectFoodWherePrice_Click(object sender, EventArgs e)
            {
                try
                {
                    DataRow[] matchingRows = null;
    
                    if (comboBoxSelectWherePrice.SelectedIndex == 0)
                        matchingRows = tblFoodPrice.Select("Price = " + txtBoxSelectFoodWherePrice.Text);
                    else if (comboBoxSelectWherePrice.SelectedIndex == 1)
                        matchingRows = tblFoodPrice.Select("Price &lt; " + txtBoxSelectFoodWherePrice.Text);                 else if (comboBoxSelectWherePrice.SelectedIndex == 2)                     matchingRows = tblFoodPrice.Select("Price &gt; " + txtBoxSelectFoodWherePrice.Text);
                    else if (comboBoxSelectWherePrice.SelectedIndex == 3)
                        matchingRows = tblFoodPrice.Select("Price &lt;= " + txtBoxSelectFoodWherePrice.Text);                 else                     matchingRows = tblFoodPrice.Select("Price &gt;= " + txtBoxSelectFoodWherePrice.Text);
    
                    dataGridView1.DataSource = null;
                    DataTable tableForSelectedRows = matchingRows.CopyToDataTable();
                    dataGridView1.DataSource = tableForSelectedRows;
                    dataGridView1.Columns["Price"].DefaultCellStyle.Format = "c";
                    dataGridView1.Refresh();
                }
                catch (Exception ex)
                {
                    listBox1.Text = ex.Message;
                    listBox1.Refresh();
                }
                txtBoxSelectFoodWherePrice.Text = null;
            }
    
            private void btnSelectFoodWhereName_Click(object sender, EventArgs e)
            {
                try
                {
                    DataRow[] matchingRows = tblFoodPrice.Select("Food = '" + txtBoxSelectFoodWhereName.Text + "'");
                    dataGridView1.DataSource = null;
                    DataTable tableForSelectedRows = matchingRows.CopyToDataTable();
                    dataGridView1.DataSource = tableForSelectedRows;
                    dataGridView1.Columns["Price"].DefaultCellStyle.Format = "c";
                    dataGridView1.Refresh();
                }
                catch (Exception ex)
                {
                    listBox1.Text = ex.Message;
                    listBox1.Refresh();
                }
                txtBoxSelectFoodWhereName.Text = null;
            }
    
            private void btnCustomSelection_Click(object sender, EventArgs e)
            {
                try
                {
                    DataRow[] matchingRows = set.Tables[txtBoxSelectFromTableName.Text].Select(txtBoxCustomSelectionStatement.Text);
                    dataGridView1.DataSource = null;
                    DataTable tableForSelectedRows = matchingRows.CopyToDataTable();
                    dataGridView1.DataSource = tableForSelectedRows;
                }
                catch (Exception ex)
                {
                    listBox1.Text = ex.Message;
                }
                txtBoxSelectFromTableName.Text = null;
                txtBoxCustomSelectionStatement.Text = null;
            }
    
            private void btnAlterCustomerRow_Click(object sender, EventArgs e)
            {
                try
                {
                    dataGridView1.DataSource = tblCustomer;
                    if (tblCustomer.Select("ID = " + txtboxAlterCustomerWhereID.Text).Length != 0)
                    {
                        DataRow[] upload = tblCustomer.Select("ID = " + txtboxAlterCustomerWhereID.Text);
                        if (txtboxChangeCustomerName.Text.Length &gt; 0)
                        {
                            upload[0]["Name"] = txtboxChangeCustomerName.Text;
                        }
                        if (txtboxChangeCustomerOrder.Text.Length &gt; 0)
                        {
                            upload[0]["OrderID"] = txtboxChangeCustomerOrder.Text;
                        }
                    }
                    btnShowCustomerTable_Click(null, null);
                }
                catch (Exception ex)
                {
                    listBox1.Text = ex.Message;
                    listBox1.Refresh();
                }
                txtboxChangeCustomerName.Text = null;
                txtboxChangeCustomerOrder.Text = null;
                txtboxAlterCustomerWhereID.Text = null;
            }
    
            private void btnAlterFoodRow_Click(object sender, EventArgs e)
            {
                try
                {
                    dataGridView1.DataSource = tblFoodPrice;
                    if (tblFoodPrice.Select("ID = " + txtboxAlterFoodWhereID.Text).Length != 0)
                    {
                        DataRow[] upload = tblFoodPrice.Select("ID = " + txtboxAlterFoodWhereID.Text);
                        if (txtboxChangeFoodName.Text.Length &gt; 0)
                            upload[0]["Food"] = txtboxChangeFoodName.Text;
                        if (txtboxChangeFoodPrice.Text.Length &gt; 0)
                            upload[0]["Price"] = Convert.ToDouble(txtboxChangeFoodPrice.Text);
                    }
                    btnShowFoodTable_Click(null, null);
                }
                catch (Exception ex)
                {
                    listBox1.Text = ex.Message;
                    listBox1.Refresh();
                }
                txtboxAlterFoodWhereID.Text = null;
                txtboxChangeFoodName.Text = null;
                txtboxChangeFoodPrice.Text = null;
            }
    
            private void btnDeleteCustomerWhereID_Click(object sender, EventArgs e)
            {
                try
                {
                    dataGridView1.DataSource = tblCustomer;
                    DataRow[] toDelete = tblCustomer.Select("ID = " + txtBoxDeleteCustomerWhereID.Text);
                    toDelete[0].Delete();
                    btnShowCustomerTable_Click(null, null);
                    dataGridView1.Refresh();
                }
                catch (Exception ex)
                {
                    listBox1.Text = ex.Message;
                    listBox1.Refresh();
                }
                txtBoxDeleteCustomerWhereID.Text = null;
            }
    
            private void DeleteFoodWhereID_Click(object sender, EventArgs e)
            {
                try
                {
                    dataGridView1.DataSource = tblFoodPrice;
                    DataRow[] toDelete = tblFoodPrice.Select("ID = " + txtboxDeleteFoodWhereID.Text);
                    toDelete[0].Delete();
                    btnShowFoodTable_Click(null, null);
                    dataGridView1.Refresh();
                }
                catch (Exception ex)
                {
                    listBox1.Text = ex.Message;
                    listBox1.Refresh();
                }
                txtboxDeleteFoodWhereID.Text = null;
            }
    
            private void btnAggregateName_Click(object sender, EventArgs e)
            {
                try
                {
                    dataGridView1.DataSource = null;
                    DataTable nameAggregate = new DataTable();
                    nameAggregate.Columns.Add("Name", typeof(string));
                    nameAggregate.Columns.Add("No. of Orders", typeof(int));
                    nameAggregate.Columns.Add("Price", typeof(double));
                    nameAggregate.Columns["Name"].AllowDBNull = false;
                    nameAggregate.Columns["No. of Orders"].AllowDBNull = false;
    
                    DataTable copyTable = tblCustomer;
                    DataRow[] selected = copyTable.Select("Name IS NOT null");
                    int counter = 0;
                    double totalPrice = 0;
    
                    Boolean[] array = new Boolean[selected.Length];
                    Boolean nope = false;
    
                    for (int i = 0; i &lt; selected.Length; i++)
                    {
                        nope = false;
                        counter = 1;
                        totalPrice = 0;
                        if (array[i] == true)
                            nope = true;
                        if (nope == false &amp;&amp; selected[i]["Name"].ToString().Equals(String.Empty) == false)
                        {
                            totalPrice = Convert.ToDouble(selected[i]["Price"].ToString());
                            for (int j = i + 1; j &lt; selected.Length; j++)
                            {
                                if (selected[i]["Name"].ToString().Equals(selected[j]["Name"].ToString()) == true)
                                {
                                    counter++;
                                    totalPrice += Convert.ToDouble(selected[j]["Price"].ToString());
                                    array[j] = true;
                                }
                            }
                            nameAggregate.Rows.Add(new Object[] { selected[i]["Name"].ToString(), counter, totalPrice });
                        }
                    }
    
                    dataGridView1.DataSource = nameAggregate;
                    dataGridView1.Columns["Price"].DefaultCellStyle.Format = "c";
                    dataGridView1.Refresh();
                }
                catch (Exception ex) {
                    listBox1.Text = ex.Message;
                }
            }
    
            private void btnAggregateOrder_Click(object sender, EventArgs e)
            {
                try
                {
                    dataGridView1.DataSource = null;
                    DataTable nameAggregate = new DataTable();
                    nameAggregate.Columns.Add("Order", typeof(string));
                    nameAggregate.Columns.Add("Food ID", typeof(string));
                    nameAggregate.Columns.Add("No. of Orders", typeof(int));
                    nameAggregate.Columns["Order"].AllowDBNull = false;
                    nameAggregate.Columns["Food ID"].AllowDBNull = false;
                    nameAggregate.Columns["No. of Orders"].AllowDBNull = false;
    
                    DataTable copyTable = tblCustomer;
                    DataRow[] selected = copyTable.Select("OrderID IS NOT null");
                    int counter = 0;
    
                    Boolean[] array = new Boolean[selected.Length];
                    Boolean nope = false;
    
                    for (int i = 0; i &lt; selected.Length; i++)
                    {
                        nope = false;
                        counter = 1;
                        if (array[i] == true)
                            nope = true;
                        if (nope == false &amp;&amp; selected[i]["OrderID"].ToString().Equals(String.Empty) == false)
                        {
                            for (int j = i + 1; j &lt; selected.Length; j++)
                            {
                                if (selected[i]["OrderID"].ToString().Equals(selected[j]["OrderID"].ToString()) == true)
                                {
                                    counter++;
                                    array[j] = true;
                                }
                            }
                            nameAggregate.Rows.Add(new Object[] { selected[i]["Order"].ToString(), selected[i]["OrderID"].ToString(), counter });
                        }
                    }
    
                    dataGridView1.DataSource = nameAggregate;
                    dataGridView1.Sort(dataGridView1.Columns["Food ID"], ListSortDirection.Ascending);
                    dataGridView1.Refresh();
                }
                catch (Exception ex)
                {
                    listBox1.Text = ex.Message;
                }
            }
    
            private void btnDataGridViewTotalPrice_Click(object sender, EventArgs e)
            {
                try
                {
                    DataTable referenceTable = (DataTable)(dataGridView1.DataSource);
                    DataRow[] rowClone = referenceTable.Select();
                    DataTable cloneTable = rowClone.CopyToDataTable();
    
                    double totalPrice = 0;
                    for (int i = 0; i &lt; rowClone.Length; i++)
                    {
                        totalPrice += Convert.ToDouble(rowClone[i]["Price"].ToString());
                    }
                    Object[] totalPriceRow = new Object[dataGridView1.ColumnCount];
                    for (int i = 0; i &lt; totalPriceRow.Length; i++)
                    {
                        if (dataGridView1.Columns[i].Name.Equals("Price"))
                            totalPriceRow[i] = totalPrice;
                        else
                            totalPriceRow[i] = null;
                    }
                    cloneTable.Rows.Add(totalPriceRow);
    
                    dataGridView1.DataSource = cloneTable;
                }
                catch (Exception ex)
                {
                    listBox1.Text = ex.Message;
                }
            }
        }
    }
    

    All of the above code, is of course, useless without the lengthy Designer class for which the windows forms are generated:

    namespace ADOWindowsForm
    {
        partial class Form1
        {
            /// <summary>
            /// Required designer variable.
            /// </summary>
            private System.ComponentModel.IContainer components = null;
    
            /// <summary>
            /// Clean up any resources being used.
            /// </summary>
            /// true if managed resources should be disposed; otherwise, false.
            protected override void Dispose(bool disposing)
            {
                if (disposing &amp;&amp; (components != null))
                {
                    components.Dispose();
                }
                base.Dispose(disposing);
            }
    
            #region Windows Form Designer generated code
    
            /// <summary>
            /// Required method for Designer support - do not modify
            /// the contents of this method with the code editor.
            /// </summary>
            private void InitializeComponent()
            {
                this.btnShowCustomerTable = new System.Windows.Forms.Button();
                this.dataGridView1 = new System.Windows.Forms.DataGridView();
                this.btnAddRowCustomer = new System.Windows.Forms.Button();
                this.textBoxName = new System.Windows.Forms.TextBox();
                this.label1 = new System.Windows.Forms.Label();
                this.label2 = new System.Windows.Forms.Label();
                this.textBoxOrder = new System.Windows.Forms.TextBox();
                this.tabControl1 = new System.Windows.Forms.TabControl();
                this.tabPage1 = new System.Windows.Forms.TabPage();
                this.tabControl2 = new System.Windows.Forms.TabControl();
                this.tabPage6 = new System.Windows.Forms.TabPage();
                this.tabPage7 = new System.Windows.Forms.TabPage();
                this.txtBoxNewFoodPrice = new System.Windows.Forms.TextBox();
                this.label9 = new System.Windows.Forms.Label();
                this.label8 = new System.Windows.Forms.Label();
                this.txtboxNewFoodName = new System.Windows.Forms.TextBox();
                this.btnAddRowFood = new System.Windows.Forms.Button();
                this.tabPage3 = new System.Windows.Forms.TabPage();
                this.tabControl3 = new System.Windows.Forms.TabControl();
                this.tabPage8 = new System.Windows.Forms.TabPage();
                this.btnAlterCustomerRow = new System.Windows.Forms.Button();
                this.label3 = new System.Windows.Forms.Label();
                this.label5 = new System.Windows.Forms.Label();
                this.txtboxAlterCustomerWhereID = new System.Windows.Forms.TextBox();
                this.txtboxChangeCustomerOrder = new System.Windows.Forms.TextBox();
                this.txtboxChangeCustomerName = new System.Windows.Forms.TextBox();
                this.label4 = new System.Windows.Forms.Label();
                this.tabPage9 = new System.Windows.Forms.TabPage();
                this.txtboxChangeFoodPrice = new System.Windows.Forms.TextBox();
                this.label12 = new System.Windows.Forms.Label();
                this.label11 = new System.Windows.Forms.Label();
                this.txtboxChangeFoodName = new System.Windows.Forms.TextBox();
                this.txtboxAlterFoodWhereID = new System.Windows.Forms.TextBox();
                this.label10 = new System.Windows.Forms.Label();
                this.btnAlterFoodRow = new System.Windows.Forms.Button();
                this.tabPage4 = new System.Windows.Forms.TabPage();
                this.tabControl4 = new System.Windows.Forms.TabControl();
                this.tabPage10 = new System.Windows.Forms.TabPage();
                this.btnDeleteCustomerWhereID = new System.Windows.Forms.Button();
                this.txtBoxDeleteCustomerWhereID = new System.Windows.Forms.TextBox();
                this.label6 = new System.Windows.Forms.Label();
                this.tabPage11 = new System.Windows.Forms.TabPage();
                this.txtboxDeleteFoodWhereID = new System.Windows.Forms.TextBox();
                this.label13 = new System.Windows.Forms.Label();
                this.DeleteFoodWhereID = new System.Windows.Forms.Button();
                this.tabPage2 = new System.Windows.Forms.TabPage();
                this.tabControl5 = new System.Windows.Forms.TabControl();
                this.tabPage12 = new System.Windows.Forms.TabPage();
                this.textBoxSelectCustomerWhereOrderID = new System.Windows.Forms.TextBox();
                this.btnSelectCustomerWhereID = new System.Windows.Forms.Button();
                this.btnSelectCustomerWhereOrderID = new System.Windows.Forms.Button();
                this.btnSelectCustomerWhereOrder = new System.Windows.Forms.Button();
                this.textBoxSelectCustomerWhereID = new System.Windows.Forms.TextBox();
                this.textBoxSelectCustomerWhereOrder = new System.Windows.Forms.TextBox();
                this.tabPage13 = new System.Windows.Forms.TabPage();
                this.txtBoxSelectFoodWherePrice = new System.Windows.Forms.TextBox();
                this.SelectFoodWherePrice = new System.Windows.Forms.Button();
                this.comboBoxSelectWherePrice = new System.Windows.Forms.ComboBox();
                this.txtBoxSelectFoodWhereID = new System.Windows.Forms.TextBox();
                this.btnSelectFoodWhereID = new System.Windows.Forms.Button();
                this.tabPage5 = new System.Windows.Forms.TabPage();
                this.btnAggregateOrder = new System.Windows.Forms.Button();
                this.btnAggregateName = new System.Windows.Forms.Button();
                this.btnShowFoodTable = new System.Windows.Forms.Button();
                this.listBox1 = new System.Windows.Forms.RichTextBox();
                this.btnSelectFoodWhereName = new System.Windows.Forms.Button();
                this.txtBoxSelectFoodWhereName = new System.Windows.Forms.TextBox();
                this.tabControl6 = new System.Windows.Forms.TabControl();
                this.tabPage14 = new System.Windows.Forms.TabPage();
                this.tabPage16 = new System.Windows.Forms.TabPage();
                this.btnCustomSelection = new System.Windows.Forms.Button();
                this.label7 = new System.Windows.Forms.Label();
                this.txtBoxSelectFromTableName = new System.Windows.Forms.TextBox();
                this.label14 = new System.Windows.Forms.Label();
                this.label15 = new System.Windows.Forms.Label();
                this.txtBoxCustomSelectionStatement = new System.Windows.Forms.TextBox();
                this.btnDataGridViewTotalPrice = new System.Windows.Forms.Button();
                this.btnSelectCustomerWhereCustomer = new System.Windows.Forms.Button();
                this.textBoxSelectCustomerWhereCustomer = new System.Windows.Forms.TextBox();
                this.dataGridViewAddRowsCustomer = new System.Windows.Forms.DataGridView();
                this.btnAddRowsCustomer = new System.Windows.Forms.Button();
                this.dataGridViewAddRowsFood = new System.Windows.Forms.DataGridView();
                this.btnAddRowsFood = new System.Windows.Forms.Button();
                ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
                this.tabControl1.SuspendLayout();
                this.tabPage1.SuspendLayout();
                this.tabControl2.SuspendLayout();
                this.tabPage6.SuspendLayout();
                this.tabPage7.SuspendLayout();
                this.tabPage3.SuspendLayout();
                this.tabControl3.SuspendLayout();
                this.tabPage8.SuspendLayout();
                this.tabPage9.SuspendLayout();
                this.tabPage4.SuspendLayout();
                this.tabControl4.SuspendLayout();
                this.tabPage10.SuspendLayout();
                this.tabPage11.SuspendLayout();
                this.tabPage2.SuspendLayout();
                this.tabControl5.SuspendLayout();
                this.tabPage12.SuspendLayout();
                this.tabPage13.SuspendLayout();
                this.tabPage5.SuspendLayout();
                this.tabControl6.SuspendLayout();
                this.tabPage14.SuspendLayout();
                this.tabPage16.SuspendLayout();
                ((System.ComponentModel.ISupportInitialize)(this.dataGridViewAddRowsCustomer)).BeginInit();
                ((System.ComponentModel.ISupportInitialize)(this.dataGridViewAddRowsFood)).BeginInit();
                this.SuspendLayout();
                // 
                // btnShowCustomerTable
                // 
                this.btnShowCustomerTable.Location = new System.Drawing.Point(12, 217);
                this.btnShowCustomerTable.Name = "btnShowCustomerTable";
                this.btnShowCustomerTable.Size = new System.Drawing.Size(120, 23);
                this.btnShowCustomerTable.TabIndex = 1;
                this.btnShowCustomerTable.Text = "Show Customer Table";
                this.btnShowCustomerTable.UseVisualStyleBackColor = true;
                this.btnShowCustomerTable.Click += new System.EventHandler(this.btnShowCustomerTable_Click);
                // 
                // dataGridView1
                // 
                this.dataGridView1.AllowUserToOrderColumns = true;
                this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
                this.dataGridView1.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
                this.dataGridView1.Location = new System.Drawing.Point(138, 12);
                this.dataGridView1.Name = "dataGridView1";
                this.dataGridView1.Size = new System.Drawing.Size(553, 299);
                this.dataGridView1.TabIndex = 2;
                // 
                // btnAddRowCustomer
                // 
                this.btnAddRowCustomer.Location = new System.Drawing.Point(6, 6);
                this.btnAddRowCustomer.Name = "btnAddRowCustomer";
                this.btnAddRowCustomer.Size = new System.Drawing.Size(75, 23);
                this.btnAddRowCustomer.TabIndex = 3;
                this.btnAddRowCustomer.Text = "Add Row";
                this.btnAddRowCustomer.UseVisualStyleBackColor = true;
                this.btnAddRowCustomer.Click += new System.EventHandler(this.btnAddRowCustomer_Click);
                // 
                // textBoxName
                // 
                this.textBoxName.Location = new System.Drawing.Point(144, 6);
                this.textBoxName.Name = "textBoxName";
                this.textBoxName.Size = new System.Drawing.Size(100, 20);
                this.textBoxName.TabIndex = 5;
                // 
                // label1
                // 
                this.label1.AutoSize = true;
                this.label1.Location = new System.Drawing.Point(91, 11);
                this.label1.Name = "label1";
                this.label1.Size = new System.Drawing.Size(38, 13);
                this.label1.TabIndex = 8;
                this.label1.Text = "Name:";
                // 
                // label2
                // 
                this.label2.AutoSize = true;
                this.label2.Location = new System.Drawing.Point(91, 35);
                this.label2.Name = "label2";
                this.label2.Size = new System.Drawing.Size(47, 13);
                this.label2.TabIndex = 9;
                this.label2.Text = "OrderID:";
                // 
                // textBoxOrder
                // 
                this.textBoxOrder.Location = new System.Drawing.Point(144, 32);
                this.textBoxOrder.Name = "textBoxOrder";
                this.textBoxOrder.Size = new System.Drawing.Size(100, 20);
                this.textBoxOrder.TabIndex = 10;
                // 
                // tabControl1
                // 
                this.tabControl1.Controls.Add(this.tabPage1);
                this.tabControl1.Controls.Add(this.tabPage3);
                this.tabControl1.Controls.Add(this.tabPage4);
                this.tabControl1.Controls.Add(this.tabPage2);
                this.tabControl1.Controls.Add(this.tabPage5);
                this.tabControl1.Location = new System.Drawing.Point(13, 317);
                this.tabControl1.Name = "tabControl1";
                this.tabControl1.SelectedIndex = 0;
                this.tabControl1.Size = new System.Drawing.Size(678, 136);
                this.tabControl1.TabIndex = 13;
                // 
                // tabPage1
                // 
                this.tabPage1.Controls.Add(this.tabControl2);
                this.tabPage1.Location = new System.Drawing.Point(4, 22);
                this.tabPage1.Name = "tabPage1";
                this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
                this.tabPage1.Size = new System.Drawing.Size(670, 110);
                this.tabPage1.TabIndex = 0;
                this.tabPage1.Text = "Add Row";
                this.tabPage1.UseVisualStyleBackColor = true;
                // 
                // tabControl2
                // 
                this.tabControl2.Controls.Add(this.tabPage6);
                this.tabControl2.Controls.Add(this.tabPage7);
                this.tabControl2.Location = new System.Drawing.Point(6, 3);
                this.tabControl2.Name = "tabControl2";
                this.tabControl2.SelectedIndex = 0;
                this.tabControl2.Size = new System.Drawing.Size(658, 101);
                this.tabControl2.TabIndex = 11;
                // 
                // tabPage6
                // 
                this.tabPage6.Controls.Add(this.btnAddRowsCustomer);
                this.tabPage6.Controls.Add(this.dataGridViewAddRowsCustomer);
                this.tabPage6.Controls.Add(this.btnAddRowCustomer);
                this.tabPage6.Controls.Add(this.textBoxName);
                this.tabPage6.Controls.Add(this.textBoxOrder);
                this.tabPage6.Controls.Add(this.label1);
                this.tabPage6.Controls.Add(this.label2);
                this.tabPage6.Location = new System.Drawing.Point(4, 22);
                this.tabPage6.Name = "tabPage6";
                this.tabPage6.Padding = new System.Windows.Forms.Padding(3);
                this.tabPage6.Size = new System.Drawing.Size(650, 75);
                this.tabPage6.TabIndex = 0;
                this.tabPage6.Text = "Customer";
                this.tabPage6.UseVisualStyleBackColor = true;
                // 
                // tabPage7
                // 
                this.tabPage7.Controls.Add(this.btnAddRowsFood);
                this.tabPage7.Controls.Add(this.dataGridViewAddRowsFood);
                this.tabPage7.Controls.Add(this.txtBoxNewFoodPrice);
                this.tabPage7.Controls.Add(this.label9);
                this.tabPage7.Controls.Add(this.label8);
                this.tabPage7.Controls.Add(this.txtboxNewFoodName);
                this.tabPage7.Controls.Add(this.btnAddRowFood);
                this.tabPage7.Location = new System.Drawing.Point(4, 22);
                this.tabPage7.Name = "tabPage7";
                this.tabPage7.Padding = new System.Windows.Forms.Padding(3);
                this.tabPage7.Size = new System.Drawing.Size(650, 75);
                this.tabPage7.TabIndex = 1;
                this.tabPage7.Text = "Food";
                this.tabPage7.UseVisualStyleBackColor = true;
                // 
                // txtBoxNewFoodPrice
                // 
                this.txtBoxNewFoodPrice.Location = new System.Drawing.Point(143, 35);
                this.txtBoxNewFoodPrice.Name = "txtBoxNewFoodPrice";
                this.txtBoxNewFoodPrice.Size = new System.Drawing.Size(100, 20);
                this.txtBoxNewFoodPrice.TabIndex = 4;
                // 
                // label9
                // 
                this.label9.AutoSize = true;
                this.label9.Location = new System.Drawing.Point(88, 38);
                this.label9.Name = "label9";
                this.label9.Size = new System.Drawing.Size(34, 13);
                this.label9.TabIndex = 3;
                this.label9.Text = "Price:";
                // 
                // label8
                // 
                this.label8.AutoSize = true;
                this.label8.Location = new System.Drawing.Point(88, 12);
                this.label8.Name = "label8";
                this.label8.Size = new System.Drawing.Size(38, 13);
                this.label8.TabIndex = 2;
                this.label8.Text = "Name:";
                // 
                // txtboxNewFoodName
                // 
                this.txtboxNewFoodName.Location = new System.Drawing.Point(143, 9);
                this.txtboxNewFoodName.Name = "txtboxNewFoodName";
                this.txtboxNewFoodName.Size = new System.Drawing.Size(100, 20);
                this.txtboxNewFoodName.TabIndex = 1;
                // 
                // btnAddRowFood
                // 
                this.btnAddRowFood.Location = new System.Drawing.Point(7, 7);
                this.btnAddRowFood.Name = "btnAddRowFood";
                this.btnAddRowFood.Size = new System.Drawing.Size(75, 23);
                this.btnAddRowFood.TabIndex = 0;
                this.btnAddRowFood.Text = "Add Row";
                this.btnAddRowFood.UseVisualStyleBackColor = true;
                this.btnAddRowFood.Click += new System.EventHandler(this.btnAddRowFood_Click);
                // 
                // tabPage3
                // 
                this.tabPage3.Controls.Add(this.tabControl3);
                this.tabPage3.Location = new System.Drawing.Point(4, 22);
                this.tabPage3.Name = "tabPage3";
                this.tabPage3.Padding = new System.Windows.Forms.Padding(3);
                this.tabPage3.Size = new System.Drawing.Size(670, 110);
                this.tabPage3.TabIndex = 2;
                this.tabPage3.Text = "Alter Row";
                this.tabPage3.UseVisualStyleBackColor = true;
                // 
                // tabControl3
                // 
                this.tabControl3.Controls.Add(this.tabPage8);
                this.tabControl3.Controls.Add(this.tabPage9);
                this.tabControl3.Location = new System.Drawing.Point(6, 4);
                this.tabControl3.Name = "tabControl3";
                this.tabControl3.SelectedIndex = 0;
                this.tabControl3.Size = new System.Drawing.Size(658, 100);
                this.tabControl3.TabIndex = 7;
                // 
                // tabPage8
                // 
                this.tabPage8.Controls.Add(this.btnAlterCustomerRow);
                this.tabPage8.Controls.Add(this.label3);
                this.tabPage8.Controls.Add(this.label5);
                this.tabPage8.Controls.Add(this.txtboxAlterCustomerWhereID);
                this.tabPage8.Controls.Add(this.txtboxChangeCustomerOrder);
                this.tabPage8.Controls.Add(this.txtboxChangeCustomerName);
                this.tabPage8.Controls.Add(this.label4);
                this.tabPage8.Location = new System.Drawing.Point(4, 22);
                this.tabPage8.Name = "tabPage8";
                this.tabPage8.Padding = new System.Windows.Forms.Padding(3);
                this.tabPage8.Size = new System.Drawing.Size(650, 74);
                this.tabPage8.TabIndex = 0;
                this.tabPage8.Text = "Customer";
                this.tabPage8.UseVisualStyleBackColor = true;
                // 
                // btnAlterCustomerRow
                // 
                this.btnAlterCustomerRow.Location = new System.Drawing.Point(6, 6);
                this.btnAlterCustomerRow.Name = "btnAlterCustomerRow";
                this.btnAlterCustomerRow.Size = new System.Drawing.Size(75, 23);
                this.btnAlterCustomerRow.TabIndex = 6;
                this.btnAlterCustomerRow.Text = "Alter Row";
                this.btnAlterCustomerRow.UseVisualStyleBackColor = true;
                this.btnAlterCustomerRow.Click += new System.EventHandler(this.btnAlterCustomerRow_Click);
                // 
                // label3
                // 
                this.label3.AutoSize = true;
                this.label3.Location = new System.Drawing.Point(93, 11);
                this.label3.Name = "label3";
                this.label3.Size = new System.Drawing.Size(94, 13);
                this.label3.TabIndex = 0;
                this.label3.Text = "Altering where ID: ";
                // 
                // label5
                // 
                this.label5.AutoSize = true;
                this.label5.Location = new System.Drawing.Point(298, 11);
                this.label5.Name = "label5";
                this.label5.Size = new System.Drawing.Size(87, 13);
                this.label5.TabIndex = 5;
                this.label5.Text = "Change OrderID:";
                // 
                // txtboxAlterCustomerWhereID
                // 
                this.txtboxAlterCustomerWhereID.Location = new System.Drawing.Point(185, 8);
                this.txtboxAlterCustomerWhereID.Name = "txtboxAlterCustomerWhereID";
                this.txtboxAlterCustomerWhereID.Size = new System.Drawing.Size(100, 20);
                this.txtboxAlterCustomerWhereID.TabIndex = 1;
                // 
                // txtboxChangeCustomerOrder
                // 
                this.txtboxChangeCustomerOrder.Location = new System.Drawing.Point(390, 8);
                this.txtboxChangeCustomerOrder.Name = "txtboxChangeCustomerOrder";
                this.txtboxChangeCustomerOrder.Size = new System.Drawing.Size(100, 20);
                this.txtboxChangeCustomerOrder.TabIndex = 4;
                // 
                // txtboxChangeCustomerName
                // 
                this.txtboxChangeCustomerName.Location = new System.Drawing.Point(185, 34);
                this.txtboxChangeCustomerName.Name = "txtboxChangeCustomerName";
                this.txtboxChangeCustomerName.Size = new System.Drawing.Size(100, 20);
                this.txtboxChangeCustomerName.TabIndex = 2;
                // 
                // label4
                // 
                this.label4.AutoSize = true;
                this.label4.Location = new System.Drawing.Point(93, 37);
                this.label4.Name = "label4";
                this.label4.Size = new System.Drawing.Size(78, 13);
                this.label4.TabIndex = 3;
                this.label4.Text = "Change Name:";
                // 
                // tabPage9
                // 
                this.tabPage9.Controls.Add(this.txtboxChangeFoodPrice);
                this.tabPage9.Controls.Add(this.label12);
                this.tabPage9.Controls.Add(this.label11);
                this.tabPage9.Controls.Add(this.txtboxChangeFoodName);
                this.tabPage9.Controls.Add(this.txtboxAlterFoodWhereID);
                this.tabPage9.Controls.Add(this.label10);
                this.tabPage9.Controls.Add(this.btnAlterFoodRow);
                this.tabPage9.Location = new System.Drawing.Point(4, 22);
                this.tabPage9.Name = "tabPage9";
                this.tabPage9.Padding = new System.Windows.Forms.Padding(3);
                this.tabPage9.Size = new System.Drawing.Size(650, 74);
                this.tabPage9.TabIndex = 1;
                this.tabPage9.Text = "Food";
                this.tabPage9.UseVisualStyleBackColor = true;
                // 
                // txtboxChangeFoodPrice
                // 
                this.txtboxChangeFoodPrice.Location = new System.Drawing.Point(370, 8);
                this.txtboxChangeFoodPrice.Name = "txtboxChangeFoodPrice";
                this.txtboxChangeFoodPrice.Size = new System.Drawing.Size(100, 20);
                this.txtboxChangeFoodPrice.TabIndex = 6;
                // 
                // label12
                // 
                this.label12.AutoSize = true;
                this.label12.Location = new System.Drawing.Point(290, 11);
                this.label12.Name = "label12";
                this.label12.Size = new System.Drawing.Size(74, 13);
                this.label12.TabIndex = 5;
                this.label12.Text = "Change Price:";
                // 
                // label11
                // 
                this.label11.AutoSize = true;
                this.label11.Location = new System.Drawing.Point(87, 38);
                this.label11.Name = "label11";
                this.label11.Size = new System.Drawing.Size(78, 13);
                this.label11.TabIndex = 4;
                this.label11.Text = "Change Name:";
                // 
                // txtboxChangeFoodName
                // 
                this.txtboxChangeFoodName.Location = new System.Drawing.Point(184, 35);
                this.txtboxChangeFoodName.Name = "txtboxChangeFoodName";
                this.txtboxChangeFoodName.Size = new System.Drawing.Size(100, 20);
                this.txtboxChangeFoodName.TabIndex = 3;
                // 
                // txtboxAlterFoodWhereID
                // 
                this.txtboxAlterFoodWhereID.Location = new System.Drawing.Point(184, 8);
                this.txtboxAlterFoodWhereID.Name = "txtboxAlterFoodWhereID";
                this.txtboxAlterFoodWhereID.Size = new System.Drawing.Size(100, 20);
                this.txtboxAlterFoodWhereID.TabIndex = 2;
                // 
                // label10
                // 
                this.label10.AutoSize = true;
                this.label10.Location = new System.Drawing.Point(87, 11);
                this.label10.Name = "label10";
                this.label10.Size = new System.Drawing.Size(91, 13);
                this.label10.TabIndex = 1;
                this.label10.Text = "Altering where ID:";
                // 
                // btnAlterFoodRow
                // 
                this.btnAlterFoodRow.Location = new System.Drawing.Point(6, 6);
                this.btnAlterFoodRow.Name = "btnAlterFoodRow";
                this.btnAlterFoodRow.Size = new System.Drawing.Size(75, 23);
                this.btnAlterFoodRow.TabIndex = 0;
                this.btnAlterFoodRow.Text = "Alter Row";
                this.btnAlterFoodRow.UseVisualStyleBackColor = true;
                this.btnAlterFoodRow.Click += new System.EventHandler(this.btnAlterFoodRow_Click);
                // 
                // tabPage4
                // 
                this.tabPage4.Controls.Add(this.tabControl4);
                this.tabPage4.Location = new System.Drawing.Point(4, 22);
                this.tabPage4.Name = "tabPage4";
                this.tabPage4.Padding = new System.Windows.Forms.Padding(3);
                this.tabPage4.Size = new System.Drawing.Size(670, 110);
                this.tabPage4.TabIndex = 4;
                this.tabPage4.Text = "Delete Row";
                this.tabPage4.UseVisualStyleBackColor = true;
                // 
                // tabControl4
                // 
                this.tabControl4.Controls.Add(this.tabPage10);
                this.tabControl4.Controls.Add(this.tabPage11);
                this.tabControl4.Location = new System.Drawing.Point(6, 4);
                this.tabControl4.Name = "tabControl4";
                this.tabControl4.SelectedIndex = 0;
                this.tabControl4.Size = new System.Drawing.Size(658, 100);
                this.tabControl4.TabIndex = 3;
                // 
                // tabPage10
                // 
                this.tabPage10.Controls.Add(this.btnDeleteCustomerWhereID);
                this.tabPage10.Controls.Add(this.txtBoxDeleteCustomerWhereID);
                this.tabPage10.Controls.Add(this.label6);
                this.tabPage10.Location = new System.Drawing.Point(4, 22);
                this.tabPage10.Name = "tabPage10";
                this.tabPage10.Padding = new System.Windows.Forms.Padding(3);
                this.tabPage10.Size = new System.Drawing.Size(650, 74);
                this.tabPage10.TabIndex = 0;
                this.tabPage10.Text = "Customer";
                this.tabPage10.UseVisualStyleBackColor = true;
                // 
                // btnDeleteCustomerWhereID
                // 
                this.btnDeleteCustomerWhereID.Location = new System.Drawing.Point(6, 6);
                this.btnDeleteCustomerWhereID.Name = "btnDeleteCustomerWhereID";
                this.btnDeleteCustomerWhereID.Size = new System.Drawing.Size(75, 23);
                this.btnDeleteCustomerWhereID.TabIndex = 0;
                this.btnDeleteCustomerWhereID.Text = "Delete Row";
                this.btnDeleteCustomerWhereID.UseVisualStyleBackColor = true;
                this.btnDeleteCustomerWhereID.Click += new System.EventHandler(this.btnDeleteCustomerWhereID_Click);
                // 
                // txtBoxDeleteCustomerWhereID
                // 
                this.txtBoxDeleteCustomerWhereID.Location = new System.Drawing.Point(150, 8);
                this.txtBoxDeleteCustomerWhereID.Name = "txtBoxDeleteCustomerWhereID";
                this.txtBoxDeleteCustomerWhereID.Size = new System.Drawing.Size(100, 20);
                this.txtBoxDeleteCustomerWhereID.TabIndex = 2;
                // 
                // label6
                // 
                this.label6.AutoSize = true;
                this.label6.Location = new System.Drawing.Point(87, 11);
                this.label6.Name = "label6";
                this.label6.Size = new System.Drawing.Size(56, 13);
                this.label6.TabIndex = 1;
                this.label6.Text = "Where ID:";
                // 
                // tabPage11
                // 
                this.tabPage11.Controls.Add(this.txtboxDeleteFoodWhereID);
                this.tabPage11.Controls.Add(this.label13);
                this.tabPage11.Controls.Add(this.DeleteFoodWhereID);
                this.tabPage11.Location = new System.Drawing.Point(4, 22);
                this.tabPage11.Name = "tabPage11";
                this.tabPage11.Padding = new System.Windows.Forms.Padding(3);
                this.tabPage11.Size = new System.Drawing.Size(650, 74);
                this.tabPage11.TabIndex = 1;
                this.tabPage11.Text = "Food";
                this.tabPage11.UseVisualStyleBackColor = true;
                // 
                // txtboxDeleteFoodWhereID
                // 
                this.txtboxDeleteFoodWhereID.Location = new System.Drawing.Point(151, 9);
                this.txtboxDeleteFoodWhereID.Name = "txtboxDeleteFoodWhereID";
                this.txtboxDeleteFoodWhereID.Size = new System.Drawing.Size(100, 20);
                this.txtboxDeleteFoodWhereID.TabIndex = 2;
                // 
                // label13
                // 
                this.label13.AutoSize = true;
                this.label13.Location = new System.Drawing.Point(88, 12);
                this.label13.Name = "label13";
                this.label13.Size = new System.Drawing.Size(56, 13);
                this.label13.TabIndex = 1;
                this.label13.Text = "Where ID:";
                // 
                // DeleteFoodWhereID
                // 
                this.DeleteFoodWhereID.Location = new System.Drawing.Point(7, 7);
                this.DeleteFoodWhereID.Name = "DeleteFoodWhereID";
                this.DeleteFoodWhereID.Size = new System.Drawing.Size(75, 23);
                this.DeleteFoodWhereID.TabIndex = 0;
                this.DeleteFoodWhereID.Text = "Delete Row";
                this.DeleteFoodWhereID.UseVisualStyleBackColor = true;
                this.DeleteFoodWhereID.Click += new System.EventHandler(this.DeleteFoodWhereID_Click);
                // 
                // tabPage2
                // 
                this.tabPage2.Controls.Add(this.tabControl5);
                this.tabPage2.Location = new System.Drawing.Point(4, 22);
                this.tabPage2.Name = "tabPage2";
                this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
                this.tabPage2.Size = new System.Drawing.Size(670, 110);
                this.tabPage2.TabIndex = 5;
                this.tabPage2.Text = "Select";
                this.tabPage2.UseVisualStyleBackColor = true;
                // 
                // tabControl5
                // 
                this.tabControl5.Controls.Add(this.tabPage12);
                this.tabControl5.Controls.Add(this.tabPage13);
                this.tabControl5.Controls.Add(this.tabPage16);
                this.tabControl5.Location = new System.Drawing.Point(6, 4);
                this.tabControl5.Name = "tabControl5";
                this.tabControl5.SelectedIndex = 0;
                this.tabControl5.Size = new System.Drawing.Size(673, 100);
                this.tabControl5.TabIndex = 14;
                // 
                // tabPage12
                // 
                this.tabPage12.Controls.Add(this.textBoxSelectCustomerWhereCustomer);
                this.tabPage12.Controls.Add(this.btnSelectCustomerWhereCustomer);
                this.tabPage12.Controls.Add(this.textBoxSelectCustomerWhereOrderID);
                this.tabPage12.Controls.Add(this.btnSelectCustomerWhereID);
                this.tabPage12.Controls.Add(this.btnSelectCustomerWhereOrderID);
                this.tabPage12.Controls.Add(this.btnSelectCustomerWhereOrder);
                this.tabPage12.Controls.Add(this.textBoxSelectCustomerWhereID);
                this.tabPage12.Controls.Add(this.textBoxSelectCustomerWhereOrder);
                this.tabPage12.Location = new System.Drawing.Point(4, 22);
                this.tabPage12.Name = "tabPage12";
                this.tabPage12.Padding = new System.Windows.Forms.Padding(3);
                this.tabPage12.Size = new System.Drawing.Size(665, 74);
                this.tabPage12.TabIndex = 0;
                this.tabPage12.Text = "Customer";
                this.tabPage12.UseVisualStyleBackColor = true;
                // 
                // textBoxSelectCustomerWhereOrderID
                // 
                this.textBoxSelectCustomerWhereOrderID.Location = new System.Drawing.Point(466, 8);
                this.textBoxSelectCustomerWhereOrderID.Name = "textBoxSelectCustomerWhereOrderID";
                this.textBoxSelectCustomerWhereOrderID.Size = new System.Drawing.Size(100, 20);
                this.textBoxSelectCustomerWhereOrderID.TabIndex = 14;
                // 
                // btnSelectCustomerWhereID
                // 
                this.btnSelectCustomerWhereID.Location = new System.Drawing.Point(6, 6);
                this.btnSelectCustomerWhereID.Name = "btnSelectCustomerWhereID";
                this.btnSelectCustomerWhereID.Size = new System.Drawing.Size(171, 23);
                this.btnSelectCustomerWhereID.TabIndex = 6;
                this.btnSelectCustomerWhereID.Text = "Select Where ID";
                this.btnSelectCustomerWhereID.UseVisualStyleBackColor = true;
                this.btnSelectCustomerWhereID.Click += new System.EventHandler(this.btnSelectCustomerWhereID_Click);
                // 
                // btnSelectCustomerWhereOrderID
                // 
                this.btnSelectCustomerWhereOrderID.Location = new System.Drawing.Point(289, 6);
                this.btnSelectCustomerWhereOrderID.Name = "btnSelectCustomerWhereOrderID";
                this.btnSelectCustomerWhereOrderID.Size = new System.Drawing.Size(171, 23);
                this.btnSelectCustomerWhereOrderID.TabIndex = 13;
                this.btnSelectCustomerWhereOrderID.Text = "Select Where OrderID";
                this.btnSelectCustomerWhereOrderID.UseVisualStyleBackColor = true;
                this.btnSelectCustomerWhereOrderID.Click += new System.EventHandler(this.btnSelectCustomerWhereOrderID_Click);
                // 
                // btnSelectCustomerWhereOrder
                // 
                this.btnSelectCustomerWhereOrder.Location = new System.Drawing.Point(6, 32);
                this.btnSelectCustomerWhereOrder.Name = "btnSelectCustomerWhereOrder";
                this.btnSelectCustomerWhereOrder.Size = new System.Drawing.Size(171, 23);
                this.btnSelectCustomerWhereOrder.TabIndex = 11;
                this.btnSelectCustomerWhereOrder.Text = "Select Where Order";
                this.btnSelectCustomerWhereOrder.UseVisualStyleBackColor = true;
                this.btnSelectCustomerWhereOrder.Click += new System.EventHandler(this.btnSelectCustomerWhereOrder_Click);
                // 
                // textBoxSelectCustomerWhereID
                // 
                this.textBoxSelectCustomerWhereID.Location = new System.Drawing.Point(183, 8);
                this.textBoxSelectCustomerWhereID.Name = "textBoxSelectCustomerWhereID";
                this.textBoxSelectCustomerWhereID.Size = new System.Drawing.Size(100, 20);
                this.textBoxSelectCustomerWhereID.TabIndex = 7;
                // 
                // textBoxSelectCustomerWhereOrder
                // 
                this.textBoxSelectCustomerWhereOrder.Location = new System.Drawing.Point(183, 36);
                this.textBoxSelectCustomerWhereOrder.Name = "textBoxSelectCustomerWhereOrder";
                this.textBoxSelectCustomerWhereOrder.Size = new System.Drawing.Size(97, 20);
                this.textBoxSelectCustomerWhereOrder.TabIndex = 12;
                // 
                // tabPage13
                // 
                this.tabPage13.Controls.Add(this.txtBoxSelectFoodWhereName);
                this.tabPage13.Controls.Add(this.btnSelectFoodWhereName);
                this.tabPage13.Controls.Add(this.txtBoxSelectFoodWherePrice);
                this.tabPage13.Controls.Add(this.SelectFoodWherePrice);
                this.tabPage13.Controls.Add(this.comboBoxSelectWherePrice);
                this.tabPage13.Controls.Add(this.txtBoxSelectFoodWhereID);
                this.tabPage13.Controls.Add(this.btnSelectFoodWhereID);
                this.tabPage13.Location = new System.Drawing.Point(4, 22);
                this.tabPage13.Name = "tabPage13";
                this.tabPage13.Padding = new System.Windows.Forms.Padding(3);
                this.tabPage13.Size = new System.Drawing.Size(665, 74);
                this.tabPage13.TabIndex = 1;
                this.tabPage13.Text = "Food";
                this.tabPage13.UseVisualStyleBackColor = true;
                // 
                // txtBoxSelectFoodWherePrice
                // 
                this.txtBoxSelectFoodWherePrice.Location = new System.Drawing.Point(280, 36);
                this.txtBoxSelectFoodWherePrice.Name = "txtBoxSelectFoodWherePrice";
                this.txtBoxSelectFoodWherePrice.Size = new System.Drawing.Size(100, 20);
                this.txtBoxSelectFoodWherePrice.TabIndex = 4;
                // 
                // SelectFoodWherePrice
                // 
                this.SelectFoodWherePrice.Location = new System.Drawing.Point(6, 34);
                this.SelectFoodWherePrice.Name = "SelectFoodWherePrice";
                this.SelectFoodWherePrice.Size = new System.Drawing.Size(127, 23);
                this.SelectFoodWherePrice.TabIndex = 3;
                this.SelectFoodWherePrice.Text = "Select Where Price:";
                this.SelectFoodWherePrice.UseVisualStyleBackColor = true;
                this.SelectFoodWherePrice.Click += new System.EventHandler(this.SelectFoodWherePrice_Click);
                // 
                // comboBoxSelectWherePrice
                // 
                this.comboBoxSelectWherePrice.FormattingEnabled = true;
                this.comboBoxSelectWherePrice.Location = new System.Drawing.Point(140, 36);
                this.comboBoxSelectWherePrice.Name = "comboBoxSelectWherePrice";
                this.comboBoxSelectWherePrice.Size = new System.Drawing.Size(134, 21);
                this.comboBoxSelectWherePrice.TabIndex = 2;
                // 
                // txtBoxSelectFoodWhereID
                // 
                this.txtBoxSelectFoodWhereID.Location = new System.Drawing.Point(140, 9);
                this.txtBoxSelectFoodWhereID.Name = "txtBoxSelectFoodWhereID";
                this.txtBoxSelectFoodWhereID.Size = new System.Drawing.Size(134, 20);
                this.txtBoxSelectFoodWhereID.TabIndex = 1;
                // 
                // btnSelectFoodWhereID
                // 
                this.btnSelectFoodWhereID.Location = new System.Drawing.Point(7, 7);
                this.btnSelectFoodWhereID.Name = "btnSelectFoodWhereID";
                this.btnSelectFoodWhereID.Size = new System.Drawing.Size(127, 23);
                this.btnSelectFoodWhereID.TabIndex = 0;
                this.btnSelectFoodWhereID.Text = "Select Where ID:";
                this.btnSelectFoodWhereID.UseVisualStyleBackColor = true;
                this.btnSelectFoodWhereID.Click += new System.EventHandler(this.btnSelectFoodWhereID_Click);
                // 
                // tabPage5
                // 
                this.tabPage5.Controls.Add(this.tabControl6);
                this.tabPage5.Location = new System.Drawing.Point(4, 22);
                this.tabPage5.Name = "tabPage5";
                this.tabPage5.Padding = new System.Windows.Forms.Padding(3);
                this.tabPage5.Size = new System.Drawing.Size(670, 110);
                this.tabPage5.TabIndex = 6;
                this.tabPage5.Text = "Aggregate";
                this.tabPage5.UseVisualStyleBackColor = true;
                // 
                // btnAggregateOrder
                // 
                this.btnAggregateOrder.Location = new System.Drawing.Point(6, 35);
                this.btnAggregateOrder.Name = "btnAggregateOrder";
                this.btnAggregateOrder.Size = new System.Drawing.Size(125, 23);
                this.btnAggregateOrder.TabIndex = 1;
                this.btnAggregateOrder.Text = "Aggregate by Order";
                this.btnAggregateOrder.UseVisualStyleBackColor = true;
                this.btnAggregateOrder.Click += new System.EventHandler(this.btnAggregateOrder_Click);
                // 
                // btnAggregateName
                // 
                this.btnAggregateName.Location = new System.Drawing.Point(6, 6);
                this.btnAggregateName.Name = "btnAggregateName";
                this.btnAggregateName.Size = new System.Drawing.Size(125, 23);
                this.btnAggregateName.TabIndex = 0;
                this.btnAggregateName.Text = "Aggregate by Name";
                this.btnAggregateName.UseVisualStyleBackColor = true;
                this.btnAggregateName.Click += new System.EventHandler(this.btnAggregateName_Click);
                // 
                // btnShowFoodTable
                // 
                this.btnShowFoodTable.Location = new System.Drawing.Point(13, 247);
                this.btnShowFoodTable.Name = "btnShowFoodTable";
                this.btnShowFoodTable.Size = new System.Drawing.Size(119, 23);
                this.btnShowFoodTable.TabIndex = 14;
                this.btnShowFoodTable.Text = "Show Food Table";
                this.btnShowFoodTable.UseVisualStyleBackColor = true;
                this.btnShowFoodTable.Click += new System.EventHandler(this.btnShowFoodTable_Click);
                // 
                // listBox1
                // 
                this.listBox1.Location = new System.Drawing.Point(12, 12);
                this.listBox1.Name = "listBox1";
                this.listBox1.ReadOnly = true;
                this.listBox1.Size = new System.Drawing.Size(120, 199);
                this.listBox1.TabIndex = 15;
                this.listBox1.Text = "";
                // 
                // btnSelectFoodWhereName
                // 
                this.btnSelectFoodWhereName.Location = new System.Drawing.Point(387, 7);
                this.btnSelectFoodWhereName.Name = "btnSelectFoodWhereName";
                this.btnSelectFoodWhereName.Size = new System.Drawing.Size(115, 23);
                this.btnSelectFoodWhereName.TabIndex = 6;
                this.btnSelectFoodWhereName.Text = "Select Where Name:";
                this.btnSelectFoodWhereName.UseVisualStyleBackColor = true;
                this.btnSelectFoodWhereName.Click += new System.EventHandler(this.btnSelectFoodWhereName_Click);
                // 
                // txtBoxSelectFoodWhereName
                // 
                this.txtBoxSelectFoodWhereName.Location = new System.Drawing.Point(508, 9);
                this.txtBoxSelectFoodWhereName.Name = "txtBoxSelectFoodWhereName";
                this.txtBoxSelectFoodWhereName.Size = new System.Drawing.Size(100, 20);
                this.txtBoxSelectFoodWhereName.TabIndex = 7;
                // 
                // tabControl6
                // 
                this.tabControl6.Controls.Add(this.tabPage14);
                this.tabControl6.Location = new System.Drawing.Point(6, 7);
                this.tabControl6.Name = "tabControl6";
                this.tabControl6.SelectedIndex = 0;
                this.tabControl6.Size = new System.Drawing.Size(658, 100);
                this.tabControl6.TabIndex = 2;
                // 
                // tabPage14
                // 
                this.tabPage14.Controls.Add(this.btnAggregateName);
                this.tabPage14.Controls.Add(this.btnAggregateOrder);
                this.tabPage14.Location = new System.Drawing.Point(4, 22);
                this.tabPage14.Name = "tabPage14";
                this.tabPage14.Padding = new System.Windows.Forms.Padding(3);
                this.tabPage14.Size = new System.Drawing.Size(650, 74);
                this.tabPage14.TabIndex = 0;
                this.tabPage14.Text = "Customer";
                this.tabPage14.UseVisualStyleBackColor = true;
                // 
                // tabPage16
                // 
                this.tabPage16.Controls.Add(this.txtBoxCustomSelectionStatement);
                this.tabPage16.Controls.Add(this.label15);
                this.tabPage16.Controls.Add(this.label14);
                this.tabPage16.Controls.Add(this.txtBoxSelectFromTableName);
                this.tabPage16.Controls.Add(this.label7);
                this.tabPage16.Controls.Add(this.btnCustomSelection);
                this.tabPage16.Location = new System.Drawing.Point(4, 22);
                this.tabPage16.Name = "tabPage16";
                this.tabPage16.Padding = new System.Windows.Forms.Padding(3);
                this.tabPage16.Size = new System.Drawing.Size(665, 74);
                this.tabPage16.TabIndex = 2;
                this.tabPage16.Text = "Custom";
                this.tabPage16.UseVisualStyleBackColor = true;
                // 
                // btnCustomSelection
                // 
                this.btnCustomSelection.Location = new System.Drawing.Point(448, 22);
                this.btnCustomSelection.Name = "btnCustomSelection";
                this.btnCustomSelection.Size = new System.Drawing.Size(75, 23);
                this.btnCustomSelection.TabIndex = 0;
                this.btnCustomSelection.Text = "Select";
                this.btnCustomSelection.UseVisualStyleBackColor = true;
                this.btnCustomSelection.Click += new System.EventHandler(this.btnCustomSelection_Click);
                // 
                // label7
                // 
                this.label7.AutoSize = true;
                this.label7.Location = new System.Drawing.Point(7, 7);
                this.label7.Name = "label7";
                this.label7.Size = new System.Drawing.Size(65, 13);
                this.label7.TabIndex = 1;
                this.label7.Text = "Table Name";
                // 
                // txtBoxSelectFromTableName
                // 
                this.txtBoxSelectFromTableName.Location = new System.Drawing.Point(10, 24);
                this.txtBoxSelectFromTableName.Name = "txtBoxSelectFromTableName";
                this.txtBoxSelectFromTableName.Size = new System.Drawing.Size(100, 20);
                this.txtBoxSelectFromTableName.TabIndex = 2;
                // 
                // label14
                // 
                this.label14.AutoSize = true;
                this.label14.Location = new System.Drawing.Point(123, 7);
                this.label14.Name = "label14";
                this.label14.Size = new System.Drawing.Size(0, 13);
                this.label14.TabIndex = 3;
                // 
                // label15
                // 
                this.label15.AutoSize = true;
                this.label15.Location = new System.Drawing.Point(116, 8);
                this.label15.Name = "label15";
                this.label15.Size = new System.Drawing.Size(102, 13);
                this.label15.TabIndex = 4;
                this.label15.Text = "Selection Statement";
                // 
                // txtBoxCustomSelectionStatement
                // 
                this.txtBoxCustomSelectionStatement.Location = new System.Drawing.Point(117, 24);
                this.txtBoxCustomSelectionStatement.Name = "txtBoxCustomSelectionStatement";
                this.txtBoxCustomSelectionStatement.Size = new System.Drawing.Size(325, 20);
                this.txtBoxCustomSelectionStatement.TabIndex = 5;
                // 
                // btnDataGridViewTotalPrice
                // 
                this.btnDataGridViewTotalPrice.Location = new System.Drawing.Point(13, 277);
                this.btnDataGridViewTotalPrice.Name = "btnDataGridViewTotalPrice";
                this.btnDataGridViewTotalPrice.Size = new System.Drawing.Size(119, 23);
                this.btnDataGridViewTotalPrice.TabIndex = 16;
                this.btnDataGridViewTotalPrice.Text = "Total Price";
                this.btnDataGridViewTotalPrice.UseVisualStyleBackColor = true;
                this.btnDataGridViewTotalPrice.Click += new System.EventHandler(this.btnDataGridViewTotalPrice_Click);
                // 
                // btnSelectCustomerWhereCustomer
                // 
                this.btnSelectCustomerWhereCustomer.Location = new System.Drawing.Point(289, 32);
                this.btnSelectCustomerWhereCustomer.Name = "btnSelectCustomerWhereCustomer";
                this.btnSelectCustomerWhereCustomer.Size = new System.Drawing.Size(171, 23);
                this.btnSelectCustomerWhereCustomer.TabIndex = 15;
                this.btnSelectCustomerWhereCustomer.Text = "Select Where Customer";
                this.btnSelectCustomerWhereCustomer.UseVisualStyleBackColor = true;
                this.btnSelectCustomerWhereCustomer.Click += new System.EventHandler(this.btnSelectCustomerWhereCustomer_Click);
                // 
                // textBoxSelectCustomerWhereCustomer
                // 
                this.textBoxSelectCustomerWhereCustomer.Location = new System.Drawing.Point(467, 34);
                this.textBoxSelectCustomerWhereCustomer.Name = "textBoxSelectCustomerWhereCustomer";
                this.textBoxSelectCustomerWhereCustomer.Size = new System.Drawing.Size(100, 20);
                this.textBoxSelectCustomerWhereCustomer.TabIndex = 16;
                // 
                // dataGridViewAddRowsCustomer
                // 
                this.dataGridViewAddRowsCustomer.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
                this.dataGridViewAddRowsCustomer.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter;
                this.dataGridViewAddRowsCustomer.Location = new System.Drawing.Point(376, 6);
                this.dataGridViewAddRowsCustomer.Name = "dataGridViewAddRowsCustomer";
                this.dataGridViewAddRowsCustomer.Size = new System.Drawing.Size(268, 63);
                this.dataGridViewAddRowsCustomer.TabIndex = 11;
                // 
                // btnAddRowsCustomer
                // 
                this.btnAddRowsCustomer.Location = new System.Drawing.Point(295, 6);
                this.btnAddRowsCustomer.Name = "btnAddRowsCustomer";
                this.btnAddRowsCustomer.Size = new System.Drawing.Size(75, 23);
                this.btnAddRowsCustomer.TabIndex = 12;
                this.btnAddRowsCustomer.Text = "Add Rows";
                this.btnAddRowsCustomer.UseVisualStyleBackColor = true;
                this.btnAddRowsCustomer.Click += new System.EventHandler(this.btnAddRowsCustomer_Click);
                // 
                // dataGridViewAddRowsFood
                // 
                this.dataGridViewAddRowsFood.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
                this.dataGridViewAddRowsFood.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnEnter;
                this.dataGridViewAddRowsFood.Location = new System.Drawing.Point(375, 6);
                this.dataGridViewAddRowsFood.Name = "dataGridViewAddRowsFood";
                this.dataGridViewAddRowsFood.Size = new System.Drawing.Size(269, 63);
                this.dataGridViewAddRowsFood.TabIndex = 5;
                // 
                // btnAddRowsFood
                // 
                this.btnAddRowsFood.Location = new System.Drawing.Point(294, 9);
                this.btnAddRowsFood.Name = "btnAddRowsFood";
                this.btnAddRowsFood.Size = new System.Drawing.Size(75, 23);
                this.btnAddRowsFood.TabIndex = 13;
                this.btnAddRowsFood.Text = "Add Rows";
                this.btnAddRowsFood.UseVisualStyleBackColor = true;
                this.btnAddRowsFood.Click += new System.EventHandler(this.btnAddRowsFood_Click);
                // 
                // Form1
                // 
                this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
                this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
                this.ClientSize = new System.Drawing.Size(705, 465);
                this.Controls.Add(this.btnDataGridViewTotalPrice);
                this.Controls.Add(this.listBox1);
                this.Controls.Add(this.btnShowFoodTable);
                this.Controls.Add(this.dataGridView1);
                this.Controls.Add(this.btnShowCustomerTable);
                this.Controls.Add(this.tabControl1);
                this.Name = "Form1";
                this.Text = "ADO Windows Form";
                ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
                this.tabControl1.ResumeLayout(false);
                this.tabPage1.ResumeLayout(false);
                this.tabControl2.ResumeLayout(false);
                this.tabPage6.ResumeLayout(false);
                this.tabPage6.PerformLayout();
                this.tabPage7.ResumeLayout(false);
                this.tabPage7.PerformLayout();
                this.tabPage3.ResumeLayout(false);
                this.tabControl3.ResumeLayout(false);
                this.tabPage8.ResumeLayout(false);
                this.tabPage8.PerformLayout();
                this.tabPage9.ResumeLayout(false);
                this.tabPage9.PerformLayout();
                this.tabPage4.ResumeLayout(false);
                this.tabControl4.ResumeLayout(false);
                this.tabPage10.ResumeLayout(false);
                this.tabPage10.PerformLayout();
                this.tabPage11.ResumeLayout(false);
                this.tabPage11.PerformLayout();
                this.tabPage2.ResumeLayout(false);
                this.tabControl5.ResumeLayout(false);
                this.tabPage12.ResumeLayout(false);
                this.tabPage12.PerformLayout();
                this.tabPage13.ResumeLayout(false);
                this.tabPage13.PerformLayout();
                this.tabPage5.ResumeLayout(false);
                this.tabControl6.ResumeLayout(false);
                this.tabPage14.ResumeLayout(false);
                this.tabPage16.ResumeLayout(false);
                this.tabPage16.PerformLayout();
                ((System.ComponentModel.ISupportInitialize)(this.dataGridViewAddRowsCustomer)).EndInit();
                ((System.ComponentModel.ISupportInitialize)(this.dataGridViewAddRowsFood)).EndInit();
                this.ResumeLayout(false);
    
            }
    
            #endregion
    
            private System.Windows.Forms.Button btnShowCustomerTable;
            private System.Windows.Forms.Button btnAddRowCustomer;
            private System.Windows.Forms.TextBox textBoxName;
            private System.Windows.Forms.DataGridView dataGridView1;
            private System.Windows.Forms.Label label1;
            private System.Windows.Forms.Label label2;
            private System.Windows.Forms.TextBox textBoxOrder;
            private System.Windows.Forms.TabControl tabControl1;
            private System.Windows.Forms.TabPage tabPage1;
            private System.Windows.Forms.TabPage tabPage3;
            private System.Windows.Forms.Button btnAlterCustomerRow;
            private System.Windows.Forms.Label label5;
            private System.Windows.Forms.TextBox txtboxChangeCustomerOrder;
            private System.Windows.Forms.Label label4;
            private System.Windows.Forms.TextBox txtboxChangeCustomerName;
            private System.Windows.Forms.TextBox txtboxAlterCustomerWhereID;
            private System.Windows.Forms.Label label3;
            private System.Windows.Forms.TabPage tabPage4;
            private System.Windows.Forms.TextBox txtBoxDeleteCustomerWhereID;
            private System.Windows.Forms.Label label6;
            private System.Windows.Forms.Button btnDeleteCustomerWhereID;
            private System.Windows.Forms.TabPage tabPage2;
            private System.Windows.Forms.Button btnSelectCustomerWhereID;
            private System.Windows.Forms.TextBox textBoxSelectCustomerWhereOrder;
            private System.Windows.Forms.TextBox textBoxSelectCustomerWhereID;
            private System.Windows.Forms.Button btnSelectCustomerWhereOrder;
            private System.Windows.Forms.TabPage tabPage5;
            private System.Windows.Forms.Button btnAggregateOrder;
            private System.Windows.Forms.Button btnAggregateName;
            private System.Windows.Forms.Button btnShowFoodTable;
            private System.Windows.Forms.TabControl tabControl2;
            private System.Windows.Forms.TabPage tabPage6;
            private System.Windows.Forms.TabPage tabPage7;
            private System.Windows.Forms.Button btnAddRowFood;
            private System.Windows.Forms.Label label9;
            private System.Windows.Forms.Label label8;
            private System.Windows.Forms.TextBox txtboxNewFoodName;
            private System.Windows.Forms.TextBox txtBoxNewFoodPrice;
            private System.Windows.Forms.TabControl tabControl3;
            private System.Windows.Forms.TabPage tabPage8;
            private System.Windows.Forms.TabPage tabPage9;
            private System.Windows.Forms.Button btnAlterFoodRow;
            private System.Windows.Forms.Label label10;
            private System.Windows.Forms.TextBox txtboxChangeFoodPrice;
            private System.Windows.Forms.Label label12;
            private System.Windows.Forms.Label label11;
            private System.Windows.Forms.TextBox txtboxChangeFoodName;
            private System.Windows.Forms.TextBox txtboxAlterFoodWhereID;
            private System.Windows.Forms.TabControl tabControl4;
            private System.Windows.Forms.TabPage tabPage10;
            private System.Windows.Forms.TabPage tabPage11;
            private System.Windows.Forms.Button DeleteFoodWhereID;
            private System.Windows.Forms.TextBox txtboxDeleteFoodWhereID;
            private System.Windows.Forms.Label label13;
            private System.Windows.Forms.Button btnSelectCustomerWhereOrderID;
            private System.Windows.Forms.TabControl tabControl5;
            private System.Windows.Forms.TabPage tabPage12;
            private System.Windows.Forms.TextBox textBoxSelectCustomerWhereOrderID;
            private System.Windows.Forms.TabPage tabPage13;
            private System.Windows.Forms.TextBox txtBoxSelectFoodWhereID;
            private System.Windows.Forms.Button btnSelectFoodWhereID;
            private System.Windows.Forms.TextBox txtBoxSelectFoodWherePrice;
            private System.Windows.Forms.Button SelectFoodWherePrice;
            private System.Windows.Forms.ComboBox comboBoxSelectWherePrice;
            private System.Windows.Forms.RichTextBox listBox1;
            private System.Windows.Forms.TextBox txtBoxSelectFoodWhereName;
            private System.Windows.Forms.Button btnSelectFoodWhereName;
            private System.Windows.Forms.TabControl tabControl6;
            private System.Windows.Forms.TabPage tabPage14;
            private System.Windows.Forms.TabPage tabPage16;
            private System.Windows.Forms.Label label14;
            private System.Windows.Forms.TextBox txtBoxSelectFromTableName;
            private System.Windows.Forms.Label label7;
            private System.Windows.Forms.Button btnCustomSelection;
            private System.Windows.Forms.TextBox txtBoxCustomSelectionStatement;
            private System.Windows.Forms.Label label15;
            private System.Windows.Forms.Button btnDataGridViewTotalPrice;
            private System.Windows.Forms.TextBox textBoxSelectCustomerWhereCustomer;
            private System.Windows.Forms.Button btnSelectCustomerWhereCustomer;
            private System.Windows.Forms.DataGridView dataGridViewAddRowsCustomer;
            private System.Windows.Forms.Button btnAddRowsCustomer;
            private System.Windows.Forms.Button btnAddRowsFood;
            private System.Windows.Forms.DataGridView dataGridViewAddRowsFood;
        }
    }
    
    Design a site like this with WordPress.com
    Get started