string dbPath = @"D:\历年高考分数.db";
string sq = @"Data Source=" + dbPath;
m = new SQLiteConnection(sq);
m.Open();
SQLiteDataAdapter mAdapter = new SQLiteDataAdapter("select Volume1,Volume2 from 曲线", m);
DataSet ds = new DataSet();
mAdapter.Fill(ds);
DataTable dt = ds.Tables[0];
if (Flag == 3)
{
DataRow MyRow = dt.NewRow();
MyRow["Volume1"]= textBox1.Text;
MyRow["Volume2"]= textBox2.Text;
dt.Rows.Add(MyRow);
SQLiteCommandBuilder mySqlCommandBuilder = new SQLiteCommandBuilder(mAdapter);
mAdapter.Update(ds);
}
//设置图表的数据源
Chart1.DataSource = dt;
private void button2_Click(object sender, EventArgs e)
{
Flag = 3;
}
光添加一组数据没什么问题,如何添加多组不同的数据?