This project is read-only.
These two lines selects all fields from table dbo.Customers

 /// <summary>
 /// Gets all Customers 
 /// </summary>
 /// <param name="sender"></param>
/// <param name="e"></param>
private void ExecuteButton_Click(object sender, EventArgs e)
{
  // Create a new instance of Customers 
  Northwind.Business.Tables.dbo.Customers entities 
     = new Northwind.Business.Tables.dbo.Customers();
  // Fill a DataGridView with the collection of Customers in the corresponding table
  MainDataGridView.DataSource = entities.Items();
 }

And these ,selects all fields from view dbo.Customers, applying a where condition in fields City and Relationship

/// <summary>
/// Gets Customer and Suppliers by City View data with filters
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void ExecuteViewButton_Click(object sender, EventArgs e)
{
   // Create a new instance of Customer and Suppliers by City
   Northwind.Business.Views.dbo.Customer_and_Suppliers_by_City entities 
    = new Northwind.Business.Views.dbo.Customer_and_Suppliers_by_City();
    // Add a where condition in column City
   entities.Where.Add(Northwind.Business.Views.dbo.Customer_and_Suppliers_by_City.
   ColumnEnum.City,sqlEnum.OperandEnum.Equal, CityTextBox.Text.Trim());
   // Add a where condition in column Relationship
   entities.Where.Add(sqlEnum.ConjunctionEnum.AND,   
   Northwind.Business.Views.dbo.Customer_and_Suppliers_by_City.ColumnEnum.Relationship,
   sqlEnum.OperandEnum.Equal, RelationshipTextBox.Text.Trim());
   
   // Fill a DataGridView with the collection of Customer_and_Suppliers_by_City in the 
   //corresponding view
   MainDataGridView.DataSource = entities.Items();
}

Last edited Nov 29, 2015 at 10:20 PM by cdcespon, version 9