using PSqLiteWrapper;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Data.SQLite;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DataGridViewControl
{
	public partial class Form1 : Form
	{
		private DataTable _table;
		private SQLiteDataAdapter _adapter;
		public Form1()
		{
			InitializeComponent();
			InitInstance();
		}

		private void InitInstance()
		{
			PSqLite.DBPath = @"D:\SQLite\mydb.db";
			_adapter = PSqLite.GetAdapterSelectQuery(PSqLite.Connection, "SELECT * FROM member;");

			_table = new DataTable();
			_adapter.Fill(_table);
			dataGridView.DataSource = _table;
		}

		private void saveButton_Click(object sender, EventArgs e)
		{
			_adapter.Update(_table);
		}
	}
}
