Friday, February 24, 2012

Error while using database procedure in a gridview control

Dear Forum,

I have a gridview control which is associated to a storedprocedure with a parameter(Customer Number) to be supplied. In theDefine Custom Statement or stored procedure section I selected stored procedure and selected the stored procedure. The Define Parameter window I defaulted the Parameter Source as 'none' and default value as '%'. In the next screen, I do a test query which retuns the following error

There was an error executing the query. Please check the syntax of the command and if present, the type and values of the parameters and ensure that they are correct.

[Error 42000] [Microsoft][ODBC SQL Server Drive][SQL Server] Procedure 'SP_TransactionDetails' expects parameter'@.cnum' which was not supplied.

I am using SQL server studio 2005 version2.0.

But the same procedure, if I use as SQL Statement, it works.

Can somebody help me.

Thanks,

Hidayath

Hi

'@.cnum' seems to be Int. Does "%' match the type?


When you click test query there should pop up a window then you could input other values to see what will happen.

|||Hi Hidayath, can you post the definition of the problematical stored procedure?|||

Hi,

The problem was related to the connection. I was using the DSN on my local machine pointed to an sql server in the network. I dropped the connection and re-created a new connection with the server name it works.

Thanks

No comments:

Post a Comment