2015年12月3日 星期四

20151204_DataBase3

程式設計工藝大師

DataBase3


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

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            // TODO: 這行程式碼會將資料載入 'db1DataSet1.DataTable2' 資料表。您可以視需要進行移動或移除。
            this.dataTable2TableAdapter.Fill(this.db1DataSet1.DataTable2);
            // TODO: 這行程式碼會將資料載入 'db1DataSet.DataTable1' 資料表。您可以視需要進行移動或移除。
            this.dataTable1TableAdapter.Fill(this.db1DataSet.DataTable1);
            // TODO: 這行程式碼會將資料載入 'db1DataSet.record' 資料表。您可以視需要進行移動或移除。
            this.recordTableAdapter.Fill(this.db1DataSet.record);
            // TODO: 這行程式碼會將資料載入 'db1DataSet.person' 資料表。您可以視需要進行移動或移除。
            this.personTableAdapter.Fill(this.db1DataSet.person);

        }

        private void dataGridView4_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }

        private void dataGridView3_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            // If you are not at the end of the list, move to the next item
            // in the BindingSource.
            if (bindingSource3.Position + 1 < bindingSource3.Count)
                bindingSource3.MoveNext();

            // Otherwise, move back to the first item.
            else
                bindingSource3.MoveFirst();

            // Force the form to repaint.
            this.Invalidate();
            //textBox1.DataBindings.Add("Text", bindingSource3, "name");
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

        private void button2_Click(object sender, EventArgs e)
        {
            // If you are not at the end of the list, move to the next item
            // in the BindingSource.
            if (bindingSource3.Position + 1 > bindingSource3.Count)
                bindingSource3.MoveLast();

            // Otherwise, move back to the first item.
            else
                bindingSource3.MovePrevious();

            // Force the form to repaint.
            this.Invalidate();
            //textBox1.DataBindings.Add("Text", bindingSource3, "name");
           

        }

        private void button3_Click(object sender, EventArgs e)
        {
            textBox1.DataBindings.Add("Text", bindingSource3, "name");
        }
    }
}

沒有留言:

張貼留言