Click here to Skip to main content
15,889,992 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
hi every one
i have this procedure in sql server database
SQL
PROCEDURE  [dbo].[get_user_pern]
(@p_user nvarchar(200)  , @p_pass nvarchar(50)  , @permissionCursor CURSOR VARYING OUTPUT)
AS
SET @permissionCursor = CURSOR
FORWARD_ONLY STATIC FOR
      SELECT *
      FROM users_hor
 where user_names=@p_user and passwords=@p_pass; 
 
OPEN @permissionCursor;
go


how i can call this procedure in .net
thanks for any help
ps . i need to close this cursor or this cursor is closed automatic

[edit]Code block added, "Ignore HTML..." option disabled - OriginalGriff[/edit]
Posted
Updated 24-Apr-11 1:33am
v2

1 solution

If you are using SQL server then you don't need a cursor as output. you can directly return the recordset.
not sure why you need explicit cursor as output.

SQL
PROCEDURE  [dbo].[get_user_pern]
(@p_user nvarchar(200)  , @p_pass nvarchar(50))
AS
      SELECT *
      FROM users_hor
    where user_names=@p_user and passwords=@p_pass;
go


you can retreive this in dataset or datereader..
 
Share this answer
 
Comments
Mostafa Elsadany 24-Apr-11 9:58am    
so what a target from this cursor

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900