Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

ERROR [42000] [SQL Anywhere]Wrong number of parameters to function

$
0
0

Hello.

I'm getting an exception with ODBC error [42000] with a Stored Procedure. The real problem is that I have tried everything is in my knowledge to solve it, but it's still showing the unhandled exception. When i run the procedure via SQL, it works fine.

            clie_codigo = 'data'
            Dim conn As OdbcConnection = New OdbcConnection("DSN=" + Principal.gs_ODBC + ";UID=user;PWD=pass")
            sp.CommandText = "dba.procedure"
            sp.CommandType = CommandType.StoredProcedure
            sp.Parameters.Add("@clie_codigo", OdbcType.Char, 15)
            sp.Parameters("@clie_codigo").Value = clie_codigo
            sp.Connection = conn
            sp.Connection.Open()
            Lee = sp.ExecuteReader()

The system procedure always returns 1 row with 2 columns. (Header below)

PROCEDURE "DBA"."Procedure"( @clie_codigo char(15) )

I'm using visual studio 2008 and SQL Anywhere 11.

Thanks in advance for any help given.


Viewing all articles
Browse latest Browse all 1698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>