Error when calling sproc with varchar OUTPUT parameter


Author
Message
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I'm getting an error when I attempt to call a stored procedure that has an output parameter that is a varchar. It reports that the size is invalid with a value of 0. However, the size is clearly set in code and the code runs fine when connected directly.



I've attached a sample solution that highlights this problem. Just read the Readme.txt for details on how to run the tests.



This is a show stopper for my project, which I'm attempting to release for beta testing.



Thanks!
Attachments
TestESCallingSproc.zip (234 views, 735.00 KB)
Peter Jones
Peter Jones
Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)Advanced StrataFrame User (504 reputation)
Group: Forum Members
Posts: 386, Visits: 2.1K
Hi Greg,

A thought: should the last statement be a Select rather than a Set, i.e.

  Select @Details = 'Total amount = ' + Convert(varchar(15),IsNull(@Total,0),1) + CHAR(13) + CHAR(10)
               + 'Total Orders = ' + Convert(varchar(12),IsNull(@TotalOrders,0)) + CHAR(13) + CHAR(10)
               + 'Total Unique Products = ' + Convert(varchar(12),IsNull(@TotalProducts,0)) + CHAR(13) + CHAR(10)

Cheers, Peter

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
SQL Server allows you to set the value of a single variable using the 'Set' keyword (in addition to being able to do the same thing with 'Select'). The SQL is valid, you can test it in Query Analyzer (or SQL Server Management Studio). Further, if you run the application using ConnectionManager (direct connect to SQL Server), the BO calls the sproc successfully.



Thanks for the post in any case BigGrin
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Try this to see if it resolves your problem.  This will need to replace the Enterprise assembly on your server.
Attachments
MicroFour StrataFrame Enterprise.zip (235 views, 20.00 KB)
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
No joy. I'm getting the same error Crying
StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Did you replace the assembly within the \bin folder and recycle the application pool through IIS?  Either we gave you the wrong DLL, or the server is still looking at the old one.

Also, do you have the assembly in the GAC on the server?

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I only updated the server, but after reading this post http://forum.strataframe.net/FindPost12475.aspx, I realized that I need to update my client as well. I'm going to give that a try.
StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Well, the problem was that the value was being serialized, but after being deserialized, it wasn't being set on the parameter, so updating it on the client really shouldn't matter.  But, let me know one way or the other.
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.4K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I just updated my client, putting new enterprise dll in the SF folder in Common Files and in the GAC. I double checked that the server was updated. I restarted IIS, just to be sure. I'm still getting same error.
StrataFrame Team
S
StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)StrataFrame Developer (4.2K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Then it looks like we posted the wrong DLL.  Let me get the latest one for you.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search