public void saveImage(byte[] image, int patient_id, MySqlConnection con)
{
string sql = "select * from patient where id ="+patient_id;
DataSet ds = new DataSet("patient");
MySqlDataAdapter dAdapter = new MySqlDataAdapter(sql, con);
MySqlCommandBuilder builder = new MySqlCommandBuilder(dAdapter);
dAdapter.Fill(ds, "patient2");
try
{
ds.Tables["patient2"].Rows[0]["picture"] = image;
dAdapter.Update(ds, "patient2");
// ds.Tables["patient2"].Rows[0].AcceptChanges();
con.Close();
con.Open();
}
catch (Exception exs)
{
Console.WriteLine(exs.Message);
}
}
後的MySQL突然不能執行查詢,我怎麼能解決這個錯誤......在此之後將不執行下面的查詢後,將工作......發生了什麼?我已經嘗試過評論「con.close」和「con.open」兩種方式,...不知怎的,這是跑
你會得到什麼錯誤? – SLaks
沒有具體的錯誤...它只是沒有下一個查詢將運行..它的像mysql只是把自己關閉... –
爲什麼?怎麼了? – SLaks