ADO.NET Binding: Master Detail



   

/*
User Interfaces in C#: Windows Forms and Custom Controls
by Matthew MacDonald

Publisher: Apress
ISBN: 1590590457
*/
using System;
using System.Data;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace ADO.NET_Binding
{
    /// <summary>
    /// Summary description for MasterDetail.
    /// </summary>
    public class MasterDetail : System.Windows.Forms.Form
    {
        internal System.Windows.Forms.Label Label2;
        internal System.Windows.Forms.Label Label1;
        internal System.Windows.Forms.ListBox lstProduct;
        internal System.Windows.Forms.ListBox lstCategory;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        public MasterDetail()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose( bool disposing )
        {
            if( disposing )
            {
                if(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.Label2 = new System.Windows.Forms.Label();
            this.Label1 = new System.Windows.Forms.Label();
            this.lstProduct = new System.Windows.Forms.ListBox();
            this.lstCategory = new System.Windows.Forms.ListBox();
            this.SuspendLayout();
            // 
            // Label2
            // 
            this.Label2.Location = new System.Drawing.Point(212, 13);
            this.Label2.Name = "Label2";
            this.Label2.Size = new System.Drawing.Size(120, 16);
            this.Label2.TabIndex = 9;
            this.Label2.Text = "Products:";
            // 
            // Label1
            // 
            this.Label1.Location = new System.Drawing.Point(12, 13);
            this.Label1.Name = "Label1";
            this.Label1.Size = new System.Drawing.Size(120, 16);
            this.Label1.TabIndex = 8;
            this.Label1.Text = "Categories:";
            // 
            // lstProduct
            // 
            this.lstProduct.Location = new System.Drawing.Point(212, 29);
            this.lstProduct.Name = "lstProduct";
            this.lstProduct.Size = new System.Drawing.Size(208, 225);
            this.lstProduct.TabIndex = 7;
            // 
            // lstCategory
            // 
            this.lstCategory.Location = new System.Drawing.Point(12, 29);
            this.lstCategory.Name = "lstCategory";
            this.lstCategory.Size = new System.Drawing.Size(192, 225);
            this.lstCategory.TabIndex = 6;
            // 
            // MasterDetail
            // 
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 14);
            this.ClientSize = new System.Drawing.Size(432, 266);
            this.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                          this.Label2,
                                                                          this.Label1,
                                                                          this.lstProduct,
                                                                          this.lstCategory});
            this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            this.Name = "MasterDetail";
            this.Text = "MasterDetail";
            this.Load += new System.EventHandler(this.MasterDetail_Load);
            this.ResumeLayout(false);

        }
        #endregion


        private BindingManagerBase categoryBinding;
        private DataSet dsStore = new DataSet();


        private void MasterDetail_Load(object sender, System.EventArgs e)
        {
            dsStore.ReadXmlSchema(Application.StartupPath + "store.xsd");
            dsStore.ReadXml(Application.StartupPath + "store.xml");
        
            lstCategory.DataSource = dsStore.Tables["Categories"];
            lstCategory.DisplayMember = "CategoryName";

            lstProduct.DataSource = dsStore.Tables["Products"];
            lstProduct.DisplayMember = "ModelName";

            categoryBinding = this.BindingContext[dsStore.Tables["Categories"]];

            categoryBinding.PositionChanged += new EventHandler(Binding_PositionChanged);

            // Invoke method once to update child table at startup.
            Binding_PositionChanged(null,null);
        }

        private void Binding_PositionChanged(object sender, System.EventArgs e)
        {
            string filter;
            DataRow selectedRow;

            // Find the current category row.
            selectedRow = dsStore.Tables["Categories"].Rows[categoryBinding.Position];

            // Create a filter expression using its CategoryID.
            filter = "CategoryID=&#039;" + selectedRow["CategoryID"].ToString() + "&#039;";

            // Modify the view onto the product table.
            dsStore.Tables["Products"].DefaultView.RowFilter = filter;
        }

        [STAThread]
        static void Main() 
        {
            Application.Run(new MasterDetail());
        }
    }
}



           
          


ADO.NETBinding.zip( 76 k)

ADO.NET Binding: Handling Errors


/*
User Interfaces in C#: Windows Forms and Custom Controls
by Matthew MacDonald

Publisher: Apress
ISBN: 1590590457
*/

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace ADO.NET_Binding
{
///

/// Summary description for HandlingErrors.
///

public class HandlingErrors : System.Windows.Forms.Form
{
internal System.Windows.Forms.Label lblErrorSummary;
internal System.Windows.Forms.Button cmdNext;
internal System.Windows.Forms.Button cmdPrev;
internal System.Windows.Forms.Label Label4;
internal System.Windows.Forms.GroupBox GroupBox1;
internal System.Windows.Forms.Label Label3;
internal System.Windows.Forms.Label Label2;
internal System.Windows.Forms.Label Label1;
internal System.Windows.Forms.TextBox txtModelName;
internal System.Windows.Forms.TextBox txtDescription;
internal System.Windows.Forms.TextBox txtUnitCost;
internal System.Windows.Forms.TextBox txtModelNumber;
internal System.Windows.Forms.ComboBox cboModelName;
///

/// Required designer variable.
///

private System.ComponentModel.Container components = null;

public HandlingErrors()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();

//
// TODO: Add any constructor code after InitializeComponent call
//
}

///

/// Clean up any resources being used.
///

protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

#region Windows Form Designer generated code
///

/// Required method for Designer support – do not modify
/// the contents of this method with the code editor.
///

private void InitializeComponent()
{
this.lblErrorSummary = new System.Windows.Forms.Label();
this.cmdNext = new System.Windows.Forms.Button();
this.cmdPrev = new System.Windows.Forms.Button();
this.Label4 = new System.Windows.Forms.Label();
this.GroupBox1 = new System.Windows.Forms.GroupBox();
this.Label3 = new System.Windows.Forms.Label();
this.Label2 = new System.Windows.Forms.Label();
this.Label1 = new System.Windows.Forms.Label();
this.txtModelName = new System.Windows.Forms.TextBox();
this.txtDescription = new System.Windows.Forms.TextBox();
this.txtUnitCost = new System.Windows.Forms.TextBox();
this.txtModelNumber = new System.Windows.Forms.TextBox();
this.cboModelName = new System.Windows.Forms.ComboBox();
this.GroupBox1.SuspendLayout();
this.SuspendLayout();
//
// lblErrorSummary
//
this.lblErrorSummary.ForeColor = System.Drawing.Color.Red;
this.lblErrorSummary.Location = new System.Drawing.Point(26, 296);
this.lblErrorSummary.Name = “lblErrorSummary”;
this.lblErrorSummary.Size = new System.Drawing.Size(328, 40);
this.lblErrorSummary.TabIndex = 29;
//
// cmdNext
//
this.cmdNext.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right);
this.cmdNext.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.cmdNext.Location = new System.Drawing.Point(322, 348);
this.cmdNext.Name = “cmdNext”;
this.cmdNext.Size = new System.Drawing.Size(92, 28);
this.cmdNext.TabIndex = 28;
this.cmdNext.Text = “Next >>”;
this.cmdNext.Click += new System.EventHandler(this.cmdNext_Click);
//
// cmdPrev
//
this.cmdPrev.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left);
this.cmdPrev.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.cmdPrev.Location = new System.Drawing.Point(18, 348);
this.cmdPrev.Name = “cmdPrev”;
this.cmdPrev.Size = new System.Drawing.Size(92, 28);
this.cmdPrev.TabIndex = 27;
this.cmdPrev.Text = “<< Prev"; this.cmdPrev.Click += new System.EventHandler(this.cmdPrev_Click); // // Label4 // this.Label4.Location = new System.Drawing.Point(14, 16); this.Label4.Name = "Label4"; this.Label4.Size = new System.Drawing.Size(88, 16); this.Label4.TabIndex = 26; this.Label4.Text = "Select a Record:"; // // GroupBox1 // this.GroupBox1.Anchor = (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right); this.GroupBox1.Controls.AddRange(new System.Windows.Forms.Control[] { this.Label3, this.Label2, this.Label1, this.txtModelName, this.txtDescription, this.txtUnitCost, this.txtModelNumber}); this.GroupBox1.FlatStyle = System.Windows.Forms.FlatStyle.System; this.GroupBox1.Location = new System.Drawing.Point(14, 48); this.GroupBox1.Name = "GroupBox1"; this.GroupBox1.Size = new System.Drawing.Size(400, 228); this.GroupBox1.TabIndex = 25; this.GroupBox1.TabStop = false; // // Label3 // this.Label3.Location = new System.Drawing.Point(220, 56); this.Label3.Name = "Label3"; this.Label3.Size = new System.Drawing.Size(36, 16); this.Label3.TabIndex = 18; this.Label3.Text = "Cost:"; // // Label2 // this.Label2.Location = new System.Drawing.Point(16, 56); this.Label2.Name = "Label2"; this.Label2.Size = new System.Drawing.Size(52, 16); this.Label2.TabIndex = 17; this.Label2.Text = "Model:"; // // Label1 // this.Label1.Location = new System.Drawing.Point(16, 28); this.Label1.Name = "Label1"; this.Label1.Size = new System.Drawing.Size(52, 16); this.Label1.TabIndex = 16; this.Label1.Text = "Name:"; // // txtModelName // this.txtModelName.Location = new System.Drawing.Point(68, 24); this.txtModelName.Name = "txtModelName"; this.txtModelName.Size = new System.Drawing.Size(316, 21); this.txtModelName.TabIndex = 15; this.txtModelName.Text = ""; // // txtDescription // this.txtDescription.Location = new System.Drawing.Point(12, 92); this.txtDescription.Multiline = true; this.txtDescription.Name = "txtDescription"; this.txtDescription.Size = new System.Drawing.Size(372, 116); this.txtDescription.TabIndex = 14; this.txtDescription.Text = ""; // // txtUnitCost // this.txtUnitCost.Location = new System.Drawing.Point(256, 52); this.txtUnitCost.Name = "txtUnitCost"; this.txtUnitCost.Size = new System.Drawing.Size(128, 21); this.txtUnitCost.TabIndex = 13; this.txtUnitCost.Text = ""; // // txtModelNumber // this.txtModelNumber.Location = new System.Drawing.Point(68, 52); this.txtModelNumber.Name = "txtModelNumber"; this.txtModelNumber.Size = new System.Drawing.Size(136, 21); this.txtModelNumber.TabIndex = 12; this.txtModelNumber.Text = ""; // // cboModelName // this.cboModelName.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cboModelName.Location = new System.Drawing.Point(106, 10); this.cboModelName.Name = "cboModelName"; this.cboModelName.Size = new System.Drawing.Size(308, 21); this.cboModelName.TabIndex = 24; // // HandlingErrors // this.AutoScaleBaseSize = new System.Drawing.Size(5, 14); this.ClientSize = new System.Drawing.Size(428, 386); this.Controls.AddRange(new System.Windows.Forms.Control[] { this.lblErrorSummary, this.cmdNext, this.cmdPrev, this.Label4, this.GroupBox1, this.cboModelName}); this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.Name = "HandlingErrors"; this.Text = "HandlingErrors"; this.Load += new System.EventHandler(this.HandlingErrors_Load); this.GroupBox1.ResumeLayout(false); this.ResumeLayout(false); } #endregion [STAThread] static void Main() { Application.Run(new HandlingErrors()); } private BindingManagerBase storeBinding; private int currentPage; private bool errFlag; private void HandlingErrors_Load(object sender, System.EventArgs e) { DataSet dsStore = new DataSet(); dsStore.ReadXmlSchema(Application.StartupPath + "store.xsd"); dsStore.ReadXml(Application.StartupPath + "store.xml"); cboModelName.DataSource = dsStore.Tables["Products"]; cboModelName.DisplayMember = "ModelName"; txtModelName.DataBindings.Add("Text", dsStore.Tables["Products"], "ModelName"); txtModelNumber.DataBindings.Add("Text", dsStore.Tables["Products"], "ModelNumber"); txtUnitCost.DataBindings.Add("Text", dsStore.Tables["Products"], "UnitCost"); txtDescription.DataBindings.Add("Text", dsStore.Tables["Products"], "Description"); storeBinding = this.BindingContext[dsStore.Tables["Products"]]; storeBinding.PositionChanged += new EventHandler(Binding_PositionChanged); dsStore.Tables["Products"].ColumnChanged += new DataColumnChangeEventHandler(TableChanging); } private void Binding_PositionChanged(object sender, System.EventArgs e) { if (errFlag) { // Reset the page. storeBinding.Position = currentPage; } else { // Allow the page to change and update the currentPage variable. currentPage = storeBinding.Position; } } private void TableChanging(object sender, System.Data.DataColumnChangeEventArgs e) { string errors = DBStore.ValidateProduct(e.Row); if (errors == "") { errFlag = false; } else { errFlag = true; } lblErrorSummary.Text = errors; } private void cmdNext_Click(object sender, System.EventArgs e) { storeBinding.Position++; } private void cmdPrev_Click(object sender, System.EventArgs e) { storeBinding.Position--; } } public class DBStore { public static string ValidateProduct(DataRow row) { string errors = ""; if (((decimal)row["UnitCost"]) <= 0) { errors += "* UnitCost value too low "; } if (row["ModelNumber"].ToString() == "") { errors += "* You must specify a ModelNumber "; } if (row["ModelName"].ToString() == "") { errors += "* You must specify a ModelName "; } return errors; } } } ADO.NETBinding.zip( 76 k)[/csharp]

DataView Binding to TextBox

   


using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;

   public class Form1 : System.Windows.Forms.Form {
      private System.Windows.Forms.TextBox textBox1;
      private System.Windows.Forms.TextBox textBox2;
      private System.Data.DataSet dataSet1;
 
      private System.ComponentModel.Container components = null;

      public Form1() {
         InitializeComponent();
      }
      private void InitializeComponent() {
         this.textBox1 = new System.Windows.Forms.TextBox();
         this.textBox2 = new System.Windows.Forms.TextBox();
         this.dataSet1 = new System.Data.DataSet();
         ((System.ComponentModel.ISupportInitialize)(this.dataSet1)).BeginInit();
         this.SuspendLayout();
 
         this.textBox1.Location = new System.Drawing.Point(16, 0);
         this.textBox1.Name = "textBox1";
         this.textBox1.TabIndex = 0;
         this.textBox1.Text = "textBox1";
 
         this.textBox2.Location = new System.Drawing.Point(16, 24);
         this.textBox2.Name = "textBox2";
         this.textBox2.TabIndex = 1;
         this.textBox2.Text = "textBox2";
 
         this.dataSet1.DataSetName = "NewDataSet";
         this.dataSet1.Locale = new System.Globalization.CultureInfo("en-GB");
 
         this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
         this.ClientSize = new System.Drawing.Size(128, 45);
         this.Controls.AddRange(new System.Windows.Forms.Control[] {this.textBox2,this.textBox1});
         this.Name = "Form1";
         this.Text = "Form1";
         this.Load += new System.EventHandler(this.Form1_Load);
         ((System.ComponentModel.ISupportInitialize)(this.dataSet1)).EndInit();
         this.ResumeLayout(false);
      }

      static void Main() {
         Application.Run(new Form1());
      }

      private void Form1_Load(object sender, System.EventArgs e) {
         string connString = "server=(local)SQLEXPRESS;database=MyDatabase;Integrated Security=SSPI";
         string SQL = @"select * from employee";

         SqlConnection Conn = new SqlConnection(connString);
         SqlDataAdapter da = new SqlDataAdapter(SQL, Conn);

         da.Fill(dataSet1, "Employee");

         DataTable myTable = dataSet1.Tables["Employee"];
         DataView dv = new DataView(myTable, "FirstName=&#039;Z&#039;","FirstName", DataViewRowState.CurrentRows);

         textBox1.DataBindings.Add("Text", dv, "FirstName");
         textBox2.DataBindings.Add("Text", dv, "LastName");
      }
   }


           
          


Bind Database table column to TextBox

   

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;

    public class Form1 : System.Windows.Forms.Form {
        private System.Windows.Forms.TextBox textBox1;
        private System.Windows.Forms.TextBox textBox2;
        private System.ComponentModel.Container components = null;

        public Form1() {
            InitializeComponent();
        }

        private void InitializeComponent(){
         this.textBox1 = new System.Windows.Forms.TextBox();
         this.textBox2 = new System.Windows.Forms.TextBox();
         this.SuspendLayout();

         this.textBox1.Location = new System.Drawing.Point(8, 8);
         this.textBox1.Name = "textBox1";
         this.textBox1.Size = new System.Drawing.Size(192, 20);
         this.textBox1.TabIndex = 0;
         this.textBox1.Text = "textBox1";

         this.textBox2.Location = new System.Drawing.Point(8, 40);
         this.textBox2.Name = "textBox2";
         this.textBox2.Size = new System.Drawing.Size(184, 20);
         this.textBox2.TabIndex = 1;
         this.textBox2.Text = "textBox2";

         this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
         this.ClientSize = new System.Drawing.Size(208, 76);
         this.Controls.Add(this.textBox2);
         this.Controls.Add(this.textBox1);
         this.Name = "Form1";
         this.Text = "Form1";
         this.Load += new System.EventHandler(this.Form1_Load);
         this.ResumeLayout(false);

      }

      static void Main() {
            Application.Run(new Form1());
      }

      private void Form1_Load(object sender, System.EventArgs e) {
         string connString = "server=(local)SQLEXPRESS;database=MyDatabase;Integrated Security=SSPI";

         string sql = @"select * from employee ";

         SqlConnection conn = new SqlConnection(connString);
         SqlDataAdapter da = new SqlDataAdapter(sql, conn);
         DataSet ds = new DataSet();
         da.Fill(ds, "employee");

         // Bind to FirstName column of the Employees table 
         textBox1.DataBindings.Add("text", ds, "employee.firstname");
         // Bind to LastName column of the Employees table
         textBox2.DataBindings.Add("text", ds, "employee.lastname");
      }
    }



           
          


Bind String array to a TextBox

   

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

    public class Form1 : System.Windows.Forms.Form {
      private System.Windows.Forms.TextBox textBox1;
      private System.ComponentModel.Container components = null;

      public Form1() {
        InitializeComponent();
      }

      private void InitializeComponent(){
         this.textBox1 = new System.Windows.Forms.TextBox();
         this.SuspendLayout();

         this.textBox1.Location = new System.Drawing.Point(16, 8);
         this.textBox1.Name = "textBox1";
         this.textBox1.Size = new System.Drawing.Size(144, 20);
         this.textBox1.TabIndex = 0;
         this.textBox1.Text = "textBox1";

         this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
         this.ClientSize = new System.Drawing.Size(176, 36);
         this.Controls.Add(this.textBox1);
         this.Name = "Form1";
         this.Text = "Form1";
         this.Load += new System.EventHandler(this.Form1_Load);
         this.ResumeLayout(false);

      }
 
      static void Main() {
            Application.Run(new Form1());
      }

      private void Form1_Load(object sender, System.EventArgs e) {
         String[] names = new String[] {"A", "B", "C", "D", "E"};
         textBox1.DataBindings.Add("text", names, null);
      }
    }



           
          


Simple DataBinding to TextBox

   



using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Windows.Forms;

class Form1 : Form {
    public Form1() {
        InitializeComponent();
        DataSet ds = CreateDataSet();
        textBox.DataBindings.Add("Text", ds.Tables["Products"], "ProductName");
    }

    private DataSet CreateDataSet() {
        string customers = "SELECT * FROM Products";
        DataSet ds = new DataSet();

        using (SqlConnection con = new SqlConnection(ConfigurationSettings.ConnectionStrings["northwind"].ConnectionString)) {
            SqlDataAdapter da = new SqlDataAdapter(customers, con);

            da.Fill(ds, "Products");
        }

        return ds;
    }

    private void InitializeComponent() {
        this.textBox = new System.Windows.Forms.TextBox();
        this.SuspendLayout();
        // 
        // textBox
        // 
        this.textBox.Location = new System.Drawing.Point(13, 13);
        this.textBox.Name = "textBox";
        this.textBox.Size = new System.Drawing.Size(477, 20);
        this.textBox.TabIndex = 0;
        // 
        // Form1
        this.Controls.Add(this.textBox);
        this.ResumeLayout(false);
        this.PerformLayout();

    }



    private System.Windows.Forms.TextBox textBox;
    [STAThread]
    static void Main() {
        Application.EnableVisualStyles();
        Application.EnableRTLMirroring();
        Application.Run(new Form1());
    }
}


           
          


Bind DataSet to TextBox

   
 
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using System.Configuration;
using System.Data.SqlClient;

public class Form1 : Form {
    public Form1() {
        InitializeComponent();

        DataSet ds = CreateDataSet();

        textBox1.DataBindings.Add("Text", ds.Tables["Products"], "ProductName");
    }

    private DataSet CreateDataSet() {
        string customers = "SELECT * FROM Products";
        DataSet ds = new DataSet();

        using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["northwind"].ConnectionString)) {
            SqlDataAdapter da = new SqlDataAdapter(customers, con);

            da.Fill(ds, "Products");
        }

        return ds;
    }
    private void InitializeComponent() {
        this.textBox1 = new System.Windows.Forms.TextBox();
        this.SuspendLayout();
        // 
        // textBox1
        // 
        this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                    | System.Windows.Forms.AnchorStyles.Right)));
        this.textBox1.Location = new System.Drawing.Point(12, 12);
        this.textBox1.Name = "textBox1";
        this.textBox1.Size = new System.Drawing.Size(370, 20);
        this.textBox1.TabIndex = 0;
        // 
        // Form1
        // 
        this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
        this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
        this.ClientSize = new System.Drawing.Size(394, 44);
        this.Controls.Add(this.textBox1);
        this.Name = "Form1";
        this.Text = "SimpleDataBinding";
        this.ResumeLayout(false);
        this.PerformLayout();

    }



    private System.Windows.Forms.TextBox textBox1;
    [STAThread]
    static void Main() {
        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);
        Application.Run(new Form1());
    }
}