我已编写此代码来更新表general_ledg
con.Open()
cmd.Connection = con
cmd = New SqlClient.SqlCommand("update general_ledg set party_name ='" + Party_nameTextBox.Text + "',party_add='" + Party_addTextBox.Text + "',party_dalali='" + Party_dalaliTextBox.Text + "' where party_id = '" + Party_idTextBox.Text + "'", con)
cmd.ExecuteNonQuery()
Me.NxtradingDataSet.Clear()
Me.General_ledgTableAdapter1.GetData()
General_ledgTableAdapter1.Fill(NxtradingDataSet.general_ledg)
con.Close()
MsgBox("update successful")
数据库中的更新成功,但DataSet
未加载新值,除非我关闭表单并重新加载。