How to commit changes done in DataGridView using PetaPoco ? Something like :
namespace PetaPocoTest
{
public partial class Form1 : Form
{
PetaPoco.Database db = new PetaPoco.Database("PgConnection");
IEnumerable<customers> allCustomers;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
allCustomers = db.Query<customers>("SELECT * FROM customers");
mGrid.DataSource = allCustomers .ToList();
}
private void simpleButton1_Click(object sender, EventArgs e)
{
db.Save("customers", "custumer_id", allCustomers);
}
}
}
I finally got it. I just wasted hours on something so obvious :\