LinqToSQLite.Data db;
BindingSource bs;
private void Form1_Load(object sender, EventArgs e)
{
SQLiteConnection conn=new SQLiteConnection(@"data source=d:\My Documents\Visual Studio 2008\Projects\计算2011\DbLinq-0.20.1\PinLvDb");
db = new Data(conn);
bs = new BindingSource( );
dataGridView1.AutoGenerateColumns = true;
bs.DataSource = db.ProjectInfo;
dataGridView1.DataSource = bs;
}
private void button1_Click(object sender, EventArgs e)
{
dataGridView1.EndEdit();
db.SubmitChanges();
}
db.SubmitChanges()能把datagridview1中更改数据保存到数据库,但是 dataGridView1中输入的新的数据行和删除的数据行不能 保存到数据库 。
怎么办啊?