Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vb.net 更新不是tableadapter的成员_Vb.net_Ms Access - Fatal编程技术网

Vb.net 更新不是tableadapter的成员

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

我试图在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

这是我的代码示例

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按钮