Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Return a value from VFP stored proc
Message
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01526420
Message ID:
01526758
Views:
40
>>>Hi all, I'm trying to return a value from a VFP sp to my .NET app without success my sp is shown below
>>>
>>>
>>>proc UpdateName
>>>Lparameters Name,ID
>>>
>>>Update MyTable ;
>>>set MyName = Name where MyID = ID
>>>
>>>Return _tally
>>>
>>>EndProc
>>>
>>>
>>>
>>>I'm using a Command.ExecuteNonQuery() statement which is supposed to return the number of records affected by the query but always returns 1. If I remove the return statement it makes no difference at all.
>>
>>I usually return a string (an XML string) from my VFP sp when calling it from ASP.NET. And it works. Maybe you could try convert the value you are trying to return into a char type.
>>
>>HTH.
>
>Hi Dmitry, can you show me how you return and retrieve the return value from your sp please ? - calling my sp from the vfp command window works a treat but I need it to work from a WinForms app

I thought maybe you wanted to see the VFP code and not .NET code. So, just in case. Here is how the VFP stored procedure returns the value to .NET:
*-- Create an xml string to return.
cRetXml = '<USERINFO>' + chr(13) + ;
	 '<USER_NAME>' + aUserInfo[1] + '</USER_NAME>' + chr(13) + ;
	 '<USER_EMAIL>' + aUserInfo[2] + '</USER_EMAIL>' + chr(13) + ;			 
	 '<USER_CC>' + aUserInfo[3] + '</USER_CC>' + chr(13) + ;
	 '<USER_PHONE>' + aUserInfo[4] + '</USER_PHONE>' + chr(13) + ;			 
	 '<USER_BLDG>' + aUserInfo[5] + '</USER_BLDG>' + chr(13) + ;			 
	 '<USER_FLOOR>' + aUserInfo[6] + '</USER_FLOOR>' + chr(13) + ;			 
	 '<USER_ROOM>' + aUserInfo[7] + '</USER_ROOM>' + chr(13) + ;			 		 	 '</USERINFO>'

RETURN (cRetXml)
HTH
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform