Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning sysname data
Message
From
21/05/2004 09:43:46
 
 
To
20/05/2004 21:51:40
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00905876
Message ID:
00905991
Views:
14
You probably haven't set your OUTPUT parameter's direction up properly in your SqlCommand.Parameters. It should be like this:
Command.Parameters["@keyField"].Direction = ParameterDirection.InputOutput;
If you've already done it correctly this way, and it's still not working right, then the only other thing that I can suggest is perhaps it's the NVARCHAR. Try changing it to VARCHAR and see if that solves the problem.

~~Bonnie



>I have a problem where my sp always returns null value.
>
>The sp code is:
>ALTER PROCEDURE getKeyField
> @tableRef NVARCHAR(128),
> @keyField NVARCHAR(128) = NULL OUTPUT
>AS
>
>SET NOCOUNT ON
>
>SELECT @keyField = constraint_name FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS (NOLOCK) WHERE TABLE_NAME = @tableRef AND CONSTRAINT_TYPE = 'PRIMARY KEY'
>
>
>*******************
>
>The sp works ok if it is executed in Query Analyser, but it always returns null when I called it from asp.net
>
>The output parameter always return null.
>
>Any Idea?
>
>Thanks,
>Eka
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform