日期:2014-05-17 浏览次数:20781 次
SQLiteConnection con = new SQLiteConnection(); con.ConnectionString = @"Data Source=d:/Patient/Patient.db"; string sqlstr = "select Name,Age,MeasureTime,IsAnalyse from patientinfo"; SQLiteCommand cmd = new SQLiteCommand(sqlstr, con); SQLiteDataAdapter da = new SQLiteDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds);//问题出在这里 dataGridView2.DataSource = ds.Tables[0];
string strSQL5 = "update patientinfo set MeasureTime='" + Convert.ToDateTime(dateTimePicker2.Text.Trim()) + "' WHERE ID=" + textBox1.Text + ""; SQLiteCommand sqlcmd5 = new SQLiteCommand(strSQL5, sqlconn); sqlcmd5.ExecuteNonQuery();