更新数据库ODP Oracle.Net错误ORA 01008

时间:2017-11-06 16:41:28

标签: c# oracle

你好这个问题在几年前得到了回答,但是有些时候它没有被激活。当我用我的值运行示例时,它给了我一个ORA 01008错误但是" therow"价值观有限。

     List<string> fldList = new List<string>();

    using (OdbcConnection dbConnection = new OdbcConnection("Driver={Microsoft ODBC for Oracle};ConnectString=(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = x.x.x.xxx)(PORT = xxx)))(CONNECT_DATA =(SERVICE_NAME = xxxx)));UID=xxxx;PWD=xxx;");)
    {
      dbConnection.Open();
      OracleCommand dbCommand2 = dbConnection.CreateCommand();
      dbCommand2.CommandType = CommandType.Text;
      dbCommand2.CommandText = "update MYTABLE set estatustrama = 2 where rowid = :therow ";
      dbCommand2.Parameters.AddWithValue("therow", fldList[fldList.Count-1]);

      dbCommand2.ExecuteNonQuery();
   }

1 个答案:

答案 0 :(得分:1)

您没有使用ODP.Net。您拥有的代码是使用ODBC。对于ODBC,您不能使用命名参数,只能使用位置。 describe('The new event page', () => { it('responds with the stub', () => { cy.server(); cy.route('/dummypath', {}).as('getDummy'); cy.visit('http://localhost:3002'); // the url to visit in your app cy.wait('@getDummy').its('responseBody') .should('be.an', 'object') .and('be.empty'); }); }); 应更改为:therow