Bronco Solutions

Knowledge Management and Collaboration Platform
Welcome to Bronco Solutions Sign in | Join | Help
in Search

Andrew Renner

ASP.NET: Return variable from Stored Procedure

For whatever reason when I use the formview with an inputoutput parameter I get a crazy error Cannot convert int to nvarchar...

After some investigation when checking the parameters collection it changes my return variable to a string even though it is an int 32

<asp:Parameter Direction="InputOutput" Name="Variable" Type="Int32" />

Datatype is string using e.command.parameters("@Variable")

To correct this - set the dbtype to the correct type in the SQLDatasource on Inserting Event

e.command.parameters("@Variable").DBType = DBType.int32

Published Friday, August 26, 2005 12:11 PM by rennera

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

No Comments

Leave a Comment

(required) 
(optional)
(required) 
Submit