表不会更新. [英] table does not update.
问题描述
我使用以下方法来更新多个表,但没有得到理想的结果.
I use the following methodology to update several tables, but do not get the desired results.
Case = 8
glbintDocNum = CInt(lblDocNum.Text)
glbintCRNum = CInt(lblCRNum.Text)
glbstrDocRev = CStr(txtRev.Text)
'Set document record
If glbintDelete = 0 Then
'Set document status for cancelled CR
Me.TblDMDocMasterTableAdapter.FilterByDocNum(Me._MasterBase1_0DataSet.tblDMDocMaster, CStr(glbintDocNum))
_MasterBase1_0DataSet.tblDMDocMaster(0).blnDocEffective = False
_MasterBase1_0DataSet.tblDMDocMaster(0).blnDocObsolete = True
_MasterBase1_0DataSet.tblDMDocMaster(0).blnDocSupersede = True
_MasterBase1_0DataSet.tblDMDocMaster(0).strDocNum = CStr(glbintCRNum)
_MasterBase1_0DataSet.tblDMDocMaster(0).strDocRev = glbstrDocRev
ElseIf glbintDelete = 1 Then
'Set document status for obsoleted document
Me.TblDMDocMasterTableAdapter.FilterByDocNum(Me._MasterBase1_0DataSet.tblDMDocMaster, CStr(glbintDocNum))
_MasterBase1_0DataSet.tblDMDocMaster(0).blnDocEffective = False
_MasterBase1_0DataSet.tblDMDocMaster(0).blnDocObsolete = True
_MasterBase1_0DataSet.tblDMDocMaster(0).blnDocSupersede = False
_MasterBase1_0DataSet.tblDMDocMaster(0).strDocNum = CStr(glbintCRNum)
End If
End Select
'Create directory for new CR and document records
MakeDirectory.DMDocCabinet()
txtEfile.Text = glbstrEFile
'prtDocRecord1.Show()
'Save data inputted into form to dataset
glbblnSaved = True
Me.Validate()
Me.setMBItemNumBindingSource.EndEdit()
Me.LnkMBChgRequestBindingSource.EndEdit()
Me.tblDMDocMasterBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me._MasterBase1_0DataSet)
这涉及三个表.第一个是包含更改请求数据的表,该数据是从表单中手动放入的.该表是lnkMBChgRequest.第二个是setMBItemNumberBindingSource, 在这种情况下不会更新.第三个是tblDMDocMaster,这是我遇到麻烦的地方,因为表中的数据没有更新.
There are three tables involved in this. The first is a table that contains the change request data which is placed into that manually from within the form. That table is lnkMBChgRequest. The second is the setMBItemNumberBindingSource, which in this Case is not updated. And the third is tblDMDocMaster, which is where I am running into trouble as the data is not being updated in the table.
上面的粗体/斜体代码是应该在表中放置数据的地方,据我所知,这一切都已经发生了.但是,当我运行endEdit(s)并更新命令时,tblDMDocMaster表不会更新为 新数据.
The bolded/italisized code above is where the data is supposed to be placed into the tabe, and as far as I can tell this is all taking place. However, when I run the endEdit(s) and update commands the tblDMDocMaster table does not update to the new data.
让我知道您可能需要哪些其他信息来帮助理解我的工作.
Let me know what additional information you might need to help in understanding what I have done.
gwboolean
gwboolean
推荐答案
您不会告诉我们哪种数据库以及更多重要信息.如果它是一个距离您20000 Km的数据库,则问题可能与它是本地数据库时有所不同.
You don't tell what kind of database and more information which can be important. If it is a database which is located 20000 Km away from you, then the problem is probably different then if it is a local database.
这里报告的问题的80%是因为从本地数据库中使用了CopyIfnewer选项,如果您已建立连接字符串,则可以将其设置为解决方案资源管理器中的属性.
80% of the problems reported here are because from local databases the option CopyIfnewer is used which can be set as property in Solution Explorer if you have made your connectionstring.
Microsoft为Express用户创建了它,以使其变得更容易,问题是没人知道为什么要这样做,因为在那之前没有问题.
Microsoft created it for Express users to make it easier, the problem is that nobody understand why they did it because before that there was no problem.
这篇关于表不会更新.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!