Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/276.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
C# System.AccessViolationException-使用TableAdapter更新表_C#_Sql_Ms Access_Access Violation_Tableadapter - Fatal编程技术网

C# System.AccessViolationException-使用TableAdapter更新表

C# System.AccessViolationException-使用TableAdapter更新表,c#,sql,ms-access,access-violation,tableadapter,C#,Sql,Ms Access,Access Violation,Tableadapter,我无法更新我的选项卡。我有一只奇怪的虫子。这是我的代码的一部分,我在其中调用要更新的表的表适配器 int iD = Convert.ToInt32(txtID.Text); string name = txtName.Text; string des = richTxtDes.Text; int idCategory = Convert.ToInt32(cmbCategory.SelectedValue.ToString());

我无法更新我的选项卡。我有一只奇怪的虫子。这是我的代码的一部分,我在其中调用要更新的表的表适配器

        int iD = Convert.ToInt32(txtID.Text);
        string name = txtName.Text;
        string des = richTxtDes.Text;
        int idCategory = Convert.ToInt32(cmbCategory.SelectedValue.ToString());
        int idSupp = Convert.ToInt32(cmbSupp.SelectedValue.ToString());
        string manufacutere = txtManufacture.Text;
        string commentar= richTxtComm.Text;

        MagacinDataSetTableAdapters.InventoryTableAdapter inventariTableAdapter = new MagacinDataSetTableAdapters.InventoryTableAdapter();
        inventariTableAdapter.UpdateInventoryQuery(name,des,idCategory,idSupp,manufacutre,commentar,iD); //Here is a bug

        loadInventory();//Update dataGridView 
下面是一个用于表更新的SQL:Update
Inventory
SET
ItemName
=?,
Description
=?,
CategoryID
=?,
供应商ID
=?,
制造商
=?,
注释
=?其中
ID
=

错误图片:


我试图在网上找到一些解决方案,但没有成功。然后,我尝试使用与旧版相同的表创建新的Access数据库。我用相同的新数据库替换了旧的数据库,并且我的代码工作正常。问题是在数据库,我用了一些数据库,我在互联网上找到的,它的几年前。现在有了新的数据库,我的程序运行得很好。有趣的是,只有这张桌子有问题