Stored procedure blows up in ADO.NET

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a simple SQL Server 2000 stored procedure as follows

ALTER PROCEDURE pos_GetTransactionProduct
@authID in
A
SELECT POSTransactionProducts.prodID, POSTransactionProducts.amoun
FROM dbo.POSTransactionProduct
WHERE POSTransactionProducts.authID = @authI
ORDER BY POSTransactionProducts.prodI
RETURN

I run it in SQL Analyzer OK. It runs in the debugger OK. How ever when I run it in a C# Web service method from a SqlCommand Execute call it blows up with a messge there is a format error near "pos_GetTransactionProducts". I wrote another procedure with the same logic and a different name and got the same result. Why can I run hte proc in SQL Analyzer and even execute it from VS.NET 2003, but can't get it to execute in the application

Thanks
Eagle
 
Hi,

What's your code?

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

I have a simple SQL Server 2000 stored procedure as follows.

ALTER PROCEDURE pos_GetTransactionProducts
@authID int
AS
SELECT POSTransactionProducts.prodID, POSTransactionProducts.amount
FROM dbo.POSTransactionProducts
WHERE POSTransactionProducts.authID = @authID
ORDER BY POSTransactionProducts.prodID
RETURN

I run it in SQL Analyzer OK. It runs in the debugger OK. How ever when I
run it in a C# Web service method from a SqlCommand Execute call it blows up
with a messge there is a format error near "pos_GetTransactionProducts". I
wrote another procedure with the same logic and a different name and got the
same result. Why can I run hte proc in SQL Analyzer and even execute it
from VS.NET 2003, but can't get it to execute in the application.
 
EagleRed:

Tim, have you set your command object's .CommandType to
CommandType.StoredProcedure?
http://www.knowdotnet.com/articles/parametergotcha.html . From the error
message, this is the most likely culprit.

Like Miha said though, please post the code , it'll be a lot easier to track
down then.

HTH,

Bill
I have a simple SQL Server 2000 stored procedure as follows.

ALTER PROCEDURE pos_GetTransactionProducts
@authID int
AS
SELECT POSTransactionProducts.prodID, POSTransactionProducts.amount
FROM dbo.POSTransactionProducts
WHERE POSTransactionProducts.authID = @authID
ORDER BY POSTransactionProducts.prodID
RETURN

I run it in SQL Analyzer OK. It runs in the debugger OK. How ever when I
run it in a C# Web service method from a SqlCommand Execute call it blows up
with a messge there is a format error near "pos_GetTransactionProducts". I
wrote another procedure with the same logic and a different name and got the
same result. Why can I run hte proc in SQL Analyzer and even execute it
from VS.NET 2003, but can't get it to execute in the application.
 
Back
Top