#pragma once


namespace DisconnectedApplication {

	using namespace System;
	using namespace System::ComponentModel;
	using namespace System::Collections;
	using namespace System::Windows::Forms;
	using namespace System::Data;
	using namespace System::Drawing;
	// OleDb data provider definitions
	using namespace System::Data::OleDb;


	/// <summary>
	/// Summary for Form1
	///
	/// WARNING: If you change the name of this class, you will need to change the
	///          'Resource File Name' property for the managed resource compiler tool
	///          associated with all .resx files this class depends on.  Otherwise,
	///          the designers will not be able to interact properly with localized
	///          resources associated with this form.
	/// </summary>
	public ref class Form1 : public System::Windows::Forms::Form
	{
	public:
		Form1(void)
		{
			InitializeComponent();
			//
			//TODO: Add the constructor code here
			//
		}

	protected:
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		~Form1()
		{
			if (components)
			{
				delete components;
			}
		}
	private: System::Windows::Forms::DataGridView^  dataGridView1;
	private: DisconnectedApplication::NorthwindDataSet^  NorthwindDataSet;
	private: System::Windows::Forms::BindingSource^  productsBindingSource;
	private: DisconnectedApplication::NorthwindDataSetTableAdapters::ProductsTableAdapter^  ProductsTableAdapter;
	private: System::Windows::Forms::DataGridViewTextBoxColumn^  productIDDataGridViewTextBoxColumn;
	private: System::Windows::Forms::DataGridViewTextBoxColumn^  productNameDataGridViewTextBoxColumn;
	private: System::Windows::Forms::DataGridViewTextBoxColumn^  unitPriceDataGridViewTextBoxColumn;
	private: System::Windows::Forms::DataGridViewTextBoxColumn^  unitsInStockDataGridViewTextBoxColumn;
	private: System::Windows::Forms::ToolStrip^  MyQuery1ToolStrip;
	private: System::Windows::Forms::ToolStripButton^  MyQuery1ToolStripButton;
	private: System::Windows::Forms::ToolStripContainer^  toolStripContainer1;
	private: System::Windows::Forms::ToolStrip^  MyQuery1ToolStrip1;
	private: System::Windows::Forms::ToolStripButton^  MyQuery1ToolStripButton1;
	private: System::ComponentModel::IContainer^  components;
	protected: 

	private:
		/// <summary>
		/// Required designer variable.
		/// </summary>


#pragma 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>
		void InitializeComponent(void)
		{
			this->components = (gcnew System::ComponentModel::Container());
			this->dataGridView1 = (gcnew System::Windows::Forms::DataGridView());
			this->productIDDataGridViewTextBoxColumn = (gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
			this->productNameDataGridViewTextBoxColumn = (gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
			this->unitPriceDataGridViewTextBoxColumn = (gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
			this->unitsInStockDataGridViewTextBoxColumn = (gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
			this->productsBindingSource = (gcnew System::Windows::Forms::BindingSource(this->components));
			this->NorthwindDataSet = (gcnew DisconnectedApplication::NorthwindDataSet());
			this->MyQuery1ToolStrip = (gcnew System::Windows::Forms::ToolStrip());
			this->MyQuery1ToolStripButton = (gcnew System::Windows::Forms::ToolStripButton());
			this->ProductsTableAdapter = (gcnew DisconnectedApplication::NorthwindDataSetTableAdapters::ProductsTableAdapter());
			this->toolStripContainer1 = (gcnew System::Windows::Forms::ToolStripContainer());
			this->MyQuery1ToolStrip1 = (gcnew System::Windows::Forms::ToolStrip());
			this->MyQuery1ToolStripButton1 = (gcnew System::Windows::Forms::ToolStripButton());
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->dataGridView1))->BeginInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->productsBindingSource))->BeginInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->NorthwindDataSet))->BeginInit();
			this->MyQuery1ToolStrip->SuspendLayout();
			this->toolStripContainer1->ContentPanel->SuspendLayout();
			this->toolStripContainer1->TopToolStripPanel->SuspendLayout();
			this->toolStripContainer1->SuspendLayout();
			this->MyQuery1ToolStrip1->SuspendLayout();
			this->SuspendLayout();
			// 
			// dataGridView1
			// 
			this->dataGridView1->AllowUserToOrderColumns = true;
			this->dataGridView1->AutoGenerateColumns = false;
			this->dataGridView1->ColumnHeadersHeightSizeMode = System::Windows::Forms::DataGridViewColumnHeadersHeightSizeMode::AutoSize;
			this->dataGridView1->Columns->AddRange(gcnew cli::array< System::Windows::Forms::DataGridViewColumn^  >(4) {this->productIDDataGridViewTextBoxColumn, 
				this->productNameDataGridViewTextBoxColumn, this->unitPriceDataGridViewTextBoxColumn, this->unitsInStockDataGridViewTextBoxColumn});
			this->dataGridView1->DataSource = this->productsBindingSource;
			this->dataGridView1->Location = System::Drawing::Point(12, 12);
			this->dataGridView1->Name = L"dataGridView1";
			this->dataGridView1->Size = System::Drawing::Size(444, 309);
			this->dataGridView1->TabIndex = 0;
			// 
			// productIDDataGridViewTextBoxColumn
			// 
			this->productIDDataGridViewTextBoxColumn->DataPropertyName = L"ProductID";
			this->productIDDataGridViewTextBoxColumn->HeaderText = L"ProductID";
			this->productIDDataGridViewTextBoxColumn->Name = L"productIDDataGridViewTextBoxColumn";
			// 
			// productNameDataGridViewTextBoxColumn
			// 
			this->productNameDataGridViewTextBoxColumn->DataPropertyName = L"ProductName";
			this->productNameDataGridViewTextBoxColumn->HeaderText = L"ProductName";
			this->productNameDataGridViewTextBoxColumn->Name = L"productNameDataGridViewTextBoxColumn";
			// 
			// unitPriceDataGridViewTextBoxColumn
			// 
			this->unitPriceDataGridViewTextBoxColumn->DataPropertyName = L"UnitPrice";
			this->unitPriceDataGridViewTextBoxColumn->HeaderText = L"UnitPrice";
			this->unitPriceDataGridViewTextBoxColumn->Name = L"unitPriceDataGridViewTextBoxColumn";
			// 
			// unitsInStockDataGridViewTextBoxColumn
			// 
			this->unitsInStockDataGridViewTextBoxColumn->DataPropertyName = L"UnitsInStock";
			this->unitsInStockDataGridViewTextBoxColumn->HeaderText = L"UnitsInStock";
			this->unitsInStockDataGridViewTextBoxColumn->Name = L"unitsInStockDataGridViewTextBoxColumn";
			// 
			// productsBindingSource
			// 
			this->productsBindingSource->DataMember = L"Products";
			this->productsBindingSource->DataSource = this->NorthwindDataSet;
			// 
			// NorthwindDataSet
			// 
			this->NorthwindDataSet->DataSetName = L"NorthwindDataSet";
			this->NorthwindDataSet->SchemaSerializationMode = System::Data::SchemaSerializationMode::IncludeSchema;
			// 
			// MyQuery1ToolStrip
			// 
			this->MyQuery1ToolStrip->Dock = System::Windows::Forms::DockStyle::None;
			this->MyQuery1ToolStrip->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(1) {this->MyQuery1ToolStripButton});
			this->MyQuery1ToolStrip->Location = System::Drawing::Point(3, 0);
			this->MyQuery1ToolStrip->Name = L"MyQuery1ToolStrip";
			this->MyQuery1ToolStrip->Size = System::Drawing::Size(111, 25);
			this->MyQuery1ToolStrip->TabIndex = 1;
			this->MyQuery1ToolStrip->Text = L"MyQuery1ToolStrip";
			// 
			// MyQuery1ToolStripButton
			// 
			this->MyQuery1ToolStripButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Text;
			this->MyQuery1ToolStripButton->Name = L"MyQuery1ToolStripButton";
			this->MyQuery1ToolStripButton->Size = System::Drawing::Size(99, 22);
			this->MyQuery1ToolStripButton->Text = L"Sort Unit Price Asc";
			this->MyQuery1ToolStripButton->Click += gcnew System::EventHandler(this, &Form1::MyQuery1ToolStripButton_Click);
			// 
			// ProductsTableAdapter
			// 
			this->ProductsTableAdapter->ClearBeforeFill = true;
			// 
			// toolStripContainer1
			// 
			this->toolStripContainer1->BottomToolStripPanelVisible = false;
			// 
			// toolStripContainer1.ContentPanel
			// 
			this->toolStripContainer1->ContentPanel->AutoScroll = true;
			this->toolStripContainer1->ContentPanel->Controls->Add(this->dataGridView1);
			this->toolStripContainer1->ContentPanel->Size = System::Drawing::Size(474, 339);
			this->toolStripContainer1->Dock = System::Windows::Forms::DockStyle::Fill;
			this->toolStripContainer1->LeftToolStripPanelVisible = false;
			this->toolStripContainer1->Location = System::Drawing::Point(0, 0);
			this->toolStripContainer1->Name = L"toolStripContainer1";
			this->toolStripContainer1->RightToolStripPanelVisible = false;
			this->toolStripContainer1->Size = System::Drawing::Size(474, 364);
			this->toolStripContainer1->TabIndex = 2;
			this->toolStripContainer1->Text = L"toolStripContainer1";
			// 
			// toolStripContainer1.TopToolStripPanel
			// 
			this->toolStripContainer1->TopToolStripPanel->Controls->Add(this->MyQuery1ToolStrip);
			// 
			// MyQuery1ToolStrip1
			// 
			this->MyQuery1ToolStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(1) {this->MyQuery1ToolStripButton1});
			this->MyQuery1ToolStrip1->Location = System::Drawing::Point(0, 0);
			this->MyQuery1ToolStrip1->Name = L"MyQuery1ToolStrip1";
			this->MyQuery1ToolStrip1->Size = System::Drawing::Size(474, 25);
			this->MyQuery1ToolStrip1->TabIndex = 3;
			this->MyQuery1ToolStrip1->Text = L"MyQuery1ToolStrip1";
			// 
			// MyQuery1ToolStripButton1
			// 
			this->MyQuery1ToolStripButton1->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Text;
			this->MyQuery1ToolStripButton1->Name = L"MyQuery1ToolStripButton1";
			this->MyQuery1ToolStripButton1->Size = System::Drawing::Size(99, 22);
			this->MyQuery1ToolStripButton1->Text = L"Sort Unit Price Asc";
			this->MyQuery1ToolStripButton1->Click += gcnew System::EventHandler(this, &Form1::MyQuery1ToolStripButton1_Click);
			// 
			// Form1
			// 
			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
			this->ClientSize = System::Drawing::Size(474, 364);
			this->Controls->Add(this->MyQuery1ToolStrip1);
			this->Controls->Add(this->toolStripContainer1);
			this->Name = L"Form1";
			this->Text = L"Products";
			this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->dataGridView1))->EndInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->productsBindingSource))->EndInit();
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->NorthwindDataSet))->EndInit();
			this->MyQuery1ToolStrip->ResumeLayout(false);
			this->MyQuery1ToolStrip->PerformLayout();
			this->toolStripContainer1->ContentPanel->ResumeLayout(false);
			this->toolStripContainer1->TopToolStripPanel->ResumeLayout(false);
			this->toolStripContainer1->TopToolStripPanel->PerformLayout();
			this->toolStripContainer1->ResumeLayout(false);
			this->toolStripContainer1->PerformLayout();
			this->MyQuery1ToolStrip1->ResumeLayout(false);
			this->MyQuery1ToolStrip1->PerformLayout();
			this->ResumeLayout(false);
			this->PerformLayout();

		}
#pragma endregion
	private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e) {
				 // TODO: This line of code loads data into the 'NorthwindDataSet.Products' table. You can move, or remove it, as needed.
				 this->ProductsTableAdapter->Fill(this->NorthwindDataSet->Products);
			 }
	private: System::Void MyQuery1ToolStripButton_Click(System::Object^  sender, System::EventArgs^  e) {
				 try {
					 this->ProductsTableAdapter->MyQuery1(this->NorthwindDataSet->Products);
				 }
				 catch (System::Exception^ ex) {
					 System::Windows::Forms::MessageBox::Show(ex->Message);
				 }
			 }
private: System::Void MyQuery1ToolStripButton1_Click(System::Object^  sender, System::EventArgs^  e) {
			 try {
				 this->ProductsTableAdapter->MyQuery1(this->NorthwindDataSet->Products);
			 }
			 catch (System::Exception^ ex) {
				 System::Windows::Forms::MessageBox::Show(ex->Message);
			 }
		 }
};
}
