ExecuteNonQuery不返回行受影响的计数以进行正确的SQL查询

时间:2014-10-02 19:24:37

标签: c# sql ms-access

尽管ExecuteNonQuery有很多问题,但这个案例有点不同。我有一个SQL查询,在MS Access中执行时工作正常

enter image description here

但是当我打电话时如下:

updateStatement = "UPDATE Claims_Data SET Notes='DOS (Professional), Not In System',Visit='256', Denial_Reason='Not In System', Paid_Amt='0', Check_Num='', Check_Date=''  WHERE Subscriber_ID='4562' AND (DOS LIKE '*9/15/2014*' OR DOS LIKE '*09/15/2014*') AND CPT='99214'  AND Provider='R,P MD'"

        updateCommand = new OleDbCommand(updateStatement, cn);

        cn.Open();

        try
        {
            int count = updateCommand.ExecuteNonQuery();
        }
        catch (OleDbException ex)
        {
            MessageBox.Show(ex.Message);
        }
        finally
        {
            cn.Close();
        }

' count'的价值也来了0,我也检查了连接属性。有什么帮助吗?

0 个答案:

没有答案