|
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
|
|
|
|
|
Hi
I am currently trying to use Bitmap::FromFile function provided by GDI+. It seems that the method does not provide any notification when the specified file does not exist. Subsequent calls to Bitmap::GetPixel also does not raise any error, it just gives a result of 255 for all the A, R,G, and B values. My question is, is there a way to check whether the FromFile method has successfully loaded an image or whether the image does not exist?
Thanks!
|
|
|
|
|
GDI+ is implemented strangely. The public interface is C++ classes, but to get around the fact that there's no common Application Binary Interface for C++ on Windows, and to allow both .NET and non-Microsoft compilers to use GDI+, the main body of the implementation is contained in a DLL with a 'flat', C-style interface.
The implementation of the GDI+ classes is contained entirely within the GDI+ headers, in terms of this flat API. The Bitmap class is implemented in GdiPlusBitmap.h. Bitmap::FromFile simply creates a new Bitmap object, using the Bitmap(const WCHAR* filename, BOOL useEmbeddedColorManagement) constructor.
If an error occurs, the underlying flat API call (GdipCreateBitmapFromFileICM or GdipCreateBitmapFromFile depending on whether the second parameter is set or not) returns an error code, which the Bitmap constructor stores internally. This error code can be retrieved using the GetLastStatus method (inherited from Image ). I would expect that, if the file was not found, this method will return FileNotFound from the Status enumeration.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
It's a bit dirty, but how about..
FILE* ofp = fopen("yourfile", "r");
if(ofp != NULL)
{
fclose(ofp);
// File exists - go ahead and call Bitmap::FromFile
}
else
{
// File does NOT exist - warn the user
}
..should work alright.
Success is 99% failure
|
|
|
|
|
Hi,
I want to do something in my app when the user doesn't do anything for a period of time (doesn't move the mouse and doesn't touch any key on the keyboard). MSN Messenger, for example, makes you idle when you are inactive. I want to lock some sections of my app.
How can I test this from my app? How can I get the windows idle time?
Thanks
-----
We are what we repeatedly do. Excellence, then, is not an act, but a habit.
|
|
|
|
|
You could use :
virtual BOOL CWinApp::OnIdle( LONG lCount );
Or maybe, use a timer and handle WM_MOUSE_MOVE and WM_KEY_DOWN but this is resource consuming ( I mean polling all the time to see if something changes).
~RaGE();
|
|
|
|
|
I don't want the idle time in my app. In windows in general. I thought OnIdle is called when the application is idle.
-----
We are what we repeatedly do. Excellence, then, is not an act, but a habit.
|
|
|
|
|
Then you'll have to set a hook on the mouse and the keyboard inputs, that's the only way to know that nothing happened in "windows in general". Search for hook on Code Project (especially the article by J. Newcomer).
~RaGE();
|
|
|
|
|
Thanks for your time.
Regards,
-----
We are what we repeatedly do. Excellence, then, is not an act, but a habit.
|
|
|
|
|
I think this might be of some help:
GetLastInputInfo
The GetLastInputInfo function retrieves the time of the last input event.
BOOL GetLastInputInfo(<br />
PLASTINPUTINFO plii
);
Parameters
plii
[out] Pointer to a LASTINPUTINFO structure that receives the time of the last input event.
Return Values
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero.
Remarks
This is useful for input idle detection
Remember... testing & debugging are always part of programming ...so exterminate those stinking bugs
|
|
|
|
|
I'm just curious, where does this comes from ? the online MSDN ? I do not have it in my 2000 version.
~RaGE();
|
|
|
|
|
It is in the later MSDN libraries and on-line! I know it isn't in the standard MSDN libs that come with VC6.
Ant.
|
|
|
|
|
Here is a link to the entire article. However, if you are using Windows 9x or NT, you'll need to employ a system-wide hook. See this article for details.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
GetLastInputInfo not working properly in Windows 2000
Error: Undefined Identifier for GetLastInputInfo
please explain
Jack
|
|
|
|
|
This is what MSDN says:
Requirements
Windows NT/2000: Requires Windows NT 3.1 or later.
Windows 95/98: Requires Windows 95 or later.
Header: Declared in Winuser.h; include Windows.h.
Library: Use user32.lib.
And what do you mean by not working properly?
Can u give details on the improper working?
...Avenger
Remember... testing & debugging are always part of programming ...so exterminate those stinking bugs
|
|
|
|
|
avenger_sb25 wrote:
Windows 95/98: Requires Windows 95 or later.
The function is not available on Windows 9x platforms.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Please provide a code snippet of how you are using the function.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I am using Windows 2000 here is the snippet
#include "stdafx.h"
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
LASTINPUTINFO plii;
memset(&plii,0,sizeof(plii));
plii.cbSize = size(plii);
if(GetLastInputInfo(&plii ))
{
//code here
}
return 0;
}
Even if I declare the LASTINPUTINFO structure in the header file its not working
Sandy
|
|
|
|
|
Well, since what you have is not a true Windows application (e.g., you need a window and a message pump), I'm not sure how GetLastInputInfo() is supposed to behave. I may be incorrect, but it wouldn't hurt to at least provide the minimum.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Even if I provide a window and check the messages it gives
a error saying "Undefined Identifier for "GetLastInputInfo()
Jack
|
|
|
|
|
Is this a compiler, linker, or run-time error?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
|
What other files are being #include d in stdafx.h?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Only the windows.h and the winuser.h
Jack
|
|
|
|
|
Have you defined _WIN32_WINNT ? If not, look at line #5040 of winuser.h.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|