StrataFrame Forum

Error when calling sproc with varchar OUTPUT parameter

http://forum.strataframe.net/Topic12397.aspx

By Greg McGuffey - 11/4/2007

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!
By Peter Jones - 11/4/2007

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

By Greg McGuffey - 11/4/2007

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
By Trent L. Taylor - 11/5/2007

Try this to see if it resolves your problem.  This will need to replace the Enterprise assembly on your server.
By Greg McGuffey - 11/5/2007

No joy. I'm getting the same error Crying
By StrataFrame Team - 11/6/2007

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?

By Greg McGuffey - 11/6/2007

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.
By StrataFrame Team - 11/6/2007

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.
By Greg McGuffey - 11/6/2007

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.
By StrataFrame Team - 11/7/2007

Then it looks like we posted the wrong DLL.  Let me get the latest one for you.
By StrataFrame Team - 11/7/2007

OK, try this one on the server.
By Greg McGuffey - 11/7/2007

That did the trick! Thanks Ben! BigGrin
By Greg McGuffey - 11/7/2007

Should I update this DLL on my client too?
By Trent L. Taylor - 11/7/2007

Yes.  Put this on your client as well.
By Greg McGuffey - 11/7/2007

OK, will do. Thanks again!