none
IDbCommand Interface RRS feed

  • Question

  • Hi

     

    I need to create a class to connect two databases (SQL & Sybase). Also execute Stored procedure and sql statements.

     

    I'm using the interface IDbCommand to set the object command created depends on the dabase selected.

     

    I have a Sybase stored procedure with one input parameter and one output parameter. I created two object ASEParameter and set at the Parameter's interface property.

     

    When I execute the SP using the ExecuteNonQuery method, I check the value's output parameter
    and it returns

    '((Sybase.Data.AseClient.AseParameter)((new System.Collections.ArrayList.ArrayListDebugView(_oComando.Parameters)).Items[1])).Value' threw an exception of type 'System.NullReferenceException'

     

    But when I execute an SQL Server stored procedure, it returns a correct value.

     

    What is the difference?

    What is wrong?

     

    Regards

    Wednesday, October 24, 2007 12:23 AM

All replies

  • Have you verified that the Sybase statement works outside of the .NET environment?  Also, what are the individual values for the following?:

    • The int returned from _oComando.ExecuteNonQuery
    • _oComando.Parameters.Count
    • The parameter names and values for _oComando.Parameters following the call to ExecuteNonQuery

     

    Wednesday, October 24, 2007 5:00 PM