private void Form1_Load(object sender, EventArgs e)
{
// TODO: 這行代碼將資料加載到表“stationeryDataSet.office_stationery”中。您可以根據需要移動或洗掉它。
this.office_stationeryTableAdapter.Fill(this.stationeryDataSet.office_stationery);
}
private void button1_Click(object sender, EventArgs e)
{
stationeryDataSet.Tables["office_stationery"].Rows[0][1] = maskedTextBox1.Text;
stationeryDataSet.Tables["office_stationery"].Rows[0][4] = maskedTextBox2.Text;
stationeryDataSet.Tables["office_stationery"].Rows[0][5] = maskedTextBox3.Text;
office_stationeryTableAdapter.Update(stationeryDataSet);
MessageBox.Show("成功");
}
//全部都是拖拽的 只有這些代碼是自己寫的 但是彈出成功的視窗 可是資料庫卻沒有更改。
uj5u.com熱心網友回復:
之前寫了一個我們廠里的量檢具的程式就更新正常,這次卻出現這樣的情況,我重新建了一個專案, 可還是出現了這樣的問題! 沒有提示錯誤, 程式運行的時候資料在表中確實更新了,可是程式關閉以后再打開程式資料還是原來的資料。轉載請註明出處,本文鏈接:https://www.uj5u.com/net/226564.html
標籤:C#
