This could be an sql server database setup issue, but I am not to sure where to start looking.
I have a stored procedure :
CREATE PROCEDURE aStoredProcedure
@dteSince DATETIME = null
AS
...
The c# code to call the stored procedure is :-
using (IDataReader dr = database.ExecuteReader("aStoredProcedure"))
{
...
The c# code works fine on the Production environment. Here, dteSince will be set to null as it is not supplied as a input parameter.
Problem is when I run this in the UAT environment, it returns the message shown in the title - wrong number of parameters...
I can fix this by changing the code to :-
using (IDataReader dr = database.ExecuteReader (CommandType.StoredProcedure, "aStoredProcedure"))
{
...
The fix just masks the real problem as to how can the code fails on one environment and works fine on another.
I have dropped and recreated the stored procedure, with no luck.
Technologies used C# 2.0 & Sql Server 2005.