Error when calling sproc with varchar OUTPUT parameter
 
Home My Account Forum Try It! Buy It!
About Contact Us Site Map
StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      


12»»

Error when calling sproc with varchar OUTPUT...Expand / Collapse
Author
Message
Posted 11/04/2007 7:33:11 PM
StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: Today @ 3:11:51 PM
Posts: 1,148, Visits: 2,831
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!


  Post Attachments 
TestESCallingSproc.zip (2 views, 735.42 KB)
Post #12397
Posted 11/04/2007 10:29:16 PM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: Yesterday @ 12:50:49 AM
Posts: 217, Visits: 1,057
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

Post #12398
Posted 11/04/2007 10:43:32 PM
StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: Today @ 3:11:51 PM
Posts: 1,148, Visits: 2,831
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
Post #12399
Posted 11/05/2007 10:07:42 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 11:54:01 AM
Posts: 4,104, Visits: 4,177
Try this to see if it resolves your problem.  This will need to replace the Enterprise assembly on your server.

  Post Attachments 
MicroFour StrataFrame Enterprise.zip (3 views, 20.67 KB)
Post #12426
Posted 11/05/2007 2:45:16 PM
StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: Today @ 3:11:51 PM
Posts: 1,148, Visits: 2,831
No joy. I'm getting the same error
Post #12458
Posted 11/06/2007 9:07:56 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 06/17/2008 9:28:35 AM
Posts: 2,649, Visits: 1,863
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?


www.bungie.net
Post #12478
Posted 11/06/2007 9:09:57 AM
StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: Today @ 3:11:51 PM
Posts: 1,148, Visits: 2,831
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.
Post #12481
Posted 11/06/2007 9:29:25 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: 06/17/2008 9:28:35 AM
Posts: 2,649, Visits: 1,863
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.


www.bungie.net
Post #12488