Vb.net 更新不是tableadapter的成员
我试图在Visual Basic中将数据添加到Access数据库中,但在尝试运行代码时遇到此错误: 错误1“更新”不是的成员 “GestiuneStudenti.Gestiune\u studentDataSettableAdapters.Gestiune\u studentTableAdapter”。C:\Users\User\Documents\Visual 演播室 2013\Projects\GestiuneStudenti\GestiuneStudenti\Form1.vb 64 13 GestiuneStudenti 这是我的代码示例Vb.net 更新不是tableadapter的成员,vb.net,ms-access,Vb.net,Ms Access,我试图在Visual Basic中将数据添加到Access数据库中,但在尝试运行代码时遇到此错误: 错误1“更新”不是的成员 “GestiuneStudenti.Gestiune\u studentDataSettableAdapters.Gestiune\u studentTableAdapter”。C:\Users\User\Documents\Visual 演播室 2013\Projects\GestiuneStudenti\GestiuneStudenti\Form1.vb 64 13
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Try
Gestiune_StudentiBindingSource.EndEdit()
Gestiune_StudentiTableAdapter.Update(Gestiune_StudentiDataSet.Gestiune_Studenti)
MessageBox.Show("Intrarea a fost adaugata cu succes")
Catch ex As Exception
MessageBox.Show("Eroare la adaugarea intrarii")
End Try
我的数据库有3个表,其中2个表具有主键,第三个表将其他2个表中的主键作为外键
谢谢如果你想更新数据集,你只需要
Gestiune_StudentiTableAdapter.Update(Gestiune_StudentiDataSet)
我希望它有助于解决以下问题:
- 探索并打开xxDataSet.XSD
- 右键单击TableAdapter
- 从“配置”菜单中选择,然后单击“高级选项”按钮
- 单击“生成插入、更新和删除语句”框和“确定”按钮
- 单击Finish按钮