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

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

        private void Form1_Load(object sender, EventArgs e)
        {
//          this.zaikoTableTableAdapter1.ConnectionString = "Data Source=(local);Initial Catalog=sampleDB;User ID=sa;Password=sapassword;";
            this.dataGridView1.DataSource = this.zaikoTableTableAdapter1.GetData();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.zaikoTableTableAdapter1.Update((DBaccess.DBaccessDataSet.zaikoTableDataTable)this.dataGridView1.DataSource);
        }

        private void dataGridView1_DataError(object sender, DataGridViewDataErrorEventArgs e)
        {
            if (e.Exception != null && e.Context == DataGridViewDataErrorContexts.Commit)
                MessageBox.Show(e.Exception.Message);
        }
    }
}