Click here to Skip to main content
15,890,438 members
Home / Discussions / C#
   

C#

 
GeneralRe: .NET Pin
CWIZO6-Apr-04 2:41
CWIZO6-Apr-04 2:41 
GeneralRe: .NET Pin
Colin Angus Mackay6-Apr-04 2:45
Colin Angus Mackay6-Apr-04 2:45 
GeneralDlls Pin
jithen_dt6-Apr-04 2:33
jithen_dt6-Apr-04 2:33 
GeneralRe: Dlls Pin
Heath Stewart6-Apr-04 3:20
protectorHeath Stewart6-Apr-04 3:20 
GeneralRe: Dlls Pin
scadaguy6-Apr-04 3:24
scadaguy6-Apr-04 3:24 
GeneralClient Pinging Server Pin
Prasad Anand6-Apr-04 1:04
Prasad Anand6-Apr-04 1:04 
GeneralRe: Client Pinging Server Pin
Heath Stewart6-Apr-04 3:12
protectorHeath Stewart6-Apr-04 3:12 
GeneralOracle Stored Procedure Problem in .NET Pin
Member 3350225-Apr-04 23:27
Member 3350225-Apr-04 23:27 
My problem is this, i have a stored procedure in oracle,
and i which authenticates a user on the basis of loginName
and password.

the problem is that when i accesssed it through C#
giving the two parameter as input and one parameter as output.
there is no value return in output parameter.
can some on tell me how to get the output parameter value in my code
Thanks In Advance

//------------- stored procedure name is
===========SecurityPkg.Authenticate=============

PROCEDURE Authenticate(loginName IN VARCHAR2,loginPassword IN VARCHAR2, loginResult OUT INT )
IS
objectId NUMBER := -1;
objectPwd VARCHAR2(100);
passwordExpiredDate DATE;
BEGIN
Select OBJECT_ID,PASSWORD,PASSWORD_EXPIRES INTO objectId,objectPwd,passwordExpiredDate
From Application_User
Where Application_User.Login_Name=loginName;

IF(objectId = -1) THEN
loginResult := ACCOUNT_DOESNOT_EXITS;
END IF;

IF(objectPwd != loginPassword) THEN
loginResult := WRONG_PASSWORD;
End if;

IF(passwordExpiredDate < SYSDATE) THEN
loginResult := PASSWORD_EXPIRED;
END IF;

EXCEPTION
WHEN NO_DATA_FOUND THEN
loginResult := ACCOUNT_DOESNOT_EXITS;

END Authenticate;


//------------------- csharp code that access the above stored procedure of oracle

OracleCommand cmd=new OracleCommand();
cmd.CommandText="Security_Pkg.Authenticate";
cmd.Connection=myConnection;
cmd.CommandType=CommandType.StoredProcedure;

// first param
OracleParameter loginNameParam=new OracleParameter("loginName",OracleDbType.Varchar2);
loginNameParam.Direction=ParameterDirection.Input;
loginNameParam.Value="Ali";

// 2nd param
OracleParameter loginPasswordParam=new OracleParameter("loginPassword",OracleDbType.Varchar2);
loginPasswordParam.Direction=ParameterDirection.Input;
loginPasswordParam.Value="pass";

// 3rd param
OracleParameter loginResultParam=new OracleParameter("loginResult",OracleDbType.Int16);
loginResultParam.Direction=ParameterDirection.Output;
cmd.Parameters.Add(loginNameParam);
cmd.Parameters.Add(loginPasswordParam);
cmd.Parameters.Add(loginResultParam);

cmd.ExecuteNonQuery();

Now when i check the value of loginResultParam, its null.
can any one tell me how to get its value
GeneralRe: Oracle Stored Procedure Problem in .NET Pin
Heath Stewart6-Apr-04 3:08
protectorHeath Stewart6-Apr-04 3:08 
GeneralRe: Oracle Stored Procedure Problem in .NET Pin
Jesse Squire6-Apr-04 4:24
Jesse Squire6-Apr-04 4:24 
GeneralRe: Oracle Stored Procedure Problem in .NET Pin
Bill Dean7-Apr-04 7:17
Bill Dean7-Apr-04 7:17 
GeneralMDIChild from another child form Pin
robmays5-Apr-04 22:12
robmays5-Apr-04 22:12 
GeneralRe: MDIChild from another child form Pin
MeterMan5-Apr-04 22:59
MeterMan5-Apr-04 22:59 
GeneralRe: MDIChild from another child form Pin
LongRange.Shooter6-Apr-04 3:27
LongRange.Shooter6-Apr-04 3:27 
QuestionIs string a primitive type?? Pin
Ungi.5-Apr-04 20:05
Ungi.5-Apr-04 20:05 
AnswerRe: Is string a primitive type?? Pin
Corinna John5-Apr-04 21:50
Corinna John5-Apr-04 21:50 
GeneralRe: Is string a primitive type?? Pin
Ungi.5-Apr-04 21:56
Ungi.5-Apr-04 21:56 
GeneralRe: Is string a primitive type?? Pin
Milton Karimbekallil6-Apr-04 0:53
Milton Karimbekallil6-Apr-04 0:53 
GeneralRe: Is string a primitive type?? Pin
Ungi.6-Apr-04 2:10
Ungi.6-Apr-04 2:10 
GeneralRe: Is string a primitive type?? Pin
Heath Stewart6-Apr-04 2:59
protectorHeath Stewart6-Apr-04 2:59 
GeneralRe: Is string a primitive type?? Pin
Ungi.6-Apr-04 3:15
Ungi.6-Apr-04 3:15 
GeneralRe: Is string a primitive type?? Pin
Heath Stewart6-Apr-04 3:44
protectorHeath Stewart6-Apr-04 3:44 
AnswerRe: Is string a primitive type?? Pin
leppie6-Apr-04 7:18
leppie6-Apr-04 7:18 
GeneralRe: Is string a primitive type?? Pin
Milton Karimbekallil11-Apr-04 19:01
Milton Karimbekallil11-Apr-04 19:01 
QuestionWriting to Excel (XLS)? Pin
Carl Mercier5-Apr-04 17:04
Carl Mercier5-Apr-04 17:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.