Click here to Skip to main content
15,922,696 members
Home / Discussions / C#
   

C#

 
GeneralRe: Error management Pin
Scalee2-Jul-08 5:46
Scalee2-Jul-08 5:46 
GeneralRe: Error management Pin
Simon P Stevens2-Jul-08 5:55
Simon P Stevens2-Jul-08 5:55 
GeneralRe: Error management Pin
Simon P Stevens2-Jul-08 5:50
Simon P Stevens2-Jul-08 5:50 
GeneralRe: Error management Pin
Scalee2-Jul-08 6:05
Scalee2-Jul-08 6:05 
GeneralRe: Error management Pin
Simon P Stevens2-Jul-08 9:32
Simon P Stevens2-Jul-08 9:32 
GeneralRe: Error management Pin
Scalee2-Jul-08 9:36
Scalee2-Jul-08 9:36 
GeneralRe: Error management Pin
Simon P Stevens2-Jul-08 21:28
Simon P Stevens2-Jul-08 21:28 
Questionproblem retriving data form Oracle Pin
mateusz.matyaszek2-Jul-08 1:55
mateusz.matyaszek2-Jul-08 1:55 
Hi

I have problem retriving data form Oracle DB.
I get "Object reference is not set to an instance of an object" error on line after //****

public override void Load(int id)
{
try
{

EROS2.Library.cDataHandle dh = new EROS2.Library.cDataHandle();
dh.Add("I_PK_CAMERA_ID", id.ToString(), EROS2.Library.ValueDataType.vInteger, EROS2.Library.DiretcionType.vInput, 0);

//****
DataTable dataTable = GetDataTableFromPackage("PKG_DCMS_CAMERA.PR_GET_CAMERA", dh);

if (dataTable != null && dataTable.Rows.Count == 1)
{
DataRow dr = dataTable.Rows[0];
LoadFromDS(dr);
}
}
catch (Exception ex)
{
TCSCore.TCSWindowsEventLog.LogException(ex);
}
}




here is rest of code involved:

public DataTable GetDataTableFromPackage(string packagename, EROS2.Library.cDataHandle parameters)
{
parameters.Add("o_cursor", "", EROS2.Library.ValueDataType.vCursor, EROS2.Library.DirectionType.vOutput, 0);
parameters.Add("o_return", "", EROS2.Library.ValueDataType.vInteger, EROS2.Library.DirectionType.vOutput, 0);

return m_Database.OracleConnection.GetDataTable(packagename, parameters);
}



and the store procedure:
----------------------------------------------------------------------------

procedure PR_GET_CAMERA(I_PK_CAMERA_ID in CAMERA.PK_CAMERA_ID%type, O_CURSOR OUT CursorType, O_RETURN OUT NUMBER) AS
err_num number;
err_msg varchar2(255);
proc_name CONSTANT VARCHAR(255) := 'PR_GET_CAMERA';

BEGIN
o_return := 1;

OPEN O_CURSOR FOR
SELECT CAMERA.*, CAMERA_STATUS.DESCRIPTION as CAMERA_STATUS, ADDEVICE.ADD_DESCRIPTION as ADD_DESCRIPTION,
ADDEVICE.PK_ADD_ID as PK_ADD_ID, ADDEVICE.ADD_CAM_TYPE as IS_MOBILE_TYPE
FROM CAMERA
JOIN ADDEVICE
ON ADDEVICE.PK_ADD_ID = CAMERA.FK_ADD_ID
JOIN CAMERA_STATUS
ON CAMERA.FK_CAMERA_STATUS_ID = CAMERA_STATUS.PK_CAMERA_STATUS_ID WHERE PK_CAMERA_ID = I_PK_CAMERA_ID;

o_return := 0;

EXCEPTION WHEN OTHERS THEN
o_return:= SQLCODE;
err_num := SQLCODE;
err_msg := 'SQLCODE: ' || SQLCODE || CHR(10) || err_msg || ':' ;
pr_store_error('Err', err_msg, err_num, proc_name);
END PR_GET_CAMERA;

----------------------------------------------------------------------------
I've checked and the id is passed properly to Load(), name of store proceduere is correct and the code works fine with different store procedures (id is different and name of procedure differs). SQL query similar to store procedure returns row without problem.

Whats wrong with it then?
QuestionFile copying, byte by byte, w/progress bar Pin
ajtunbridge2-Jul-08 1:42
ajtunbridge2-Jul-08 1:42 
AnswerRe: File copying, byte by byte, w/progress bar Pin
Scalee2-Jul-08 2:01
Scalee2-Jul-08 2:01 
GeneralRe: File copying, byte by byte, w/progress bar [modified] Pin
ajtunbridge2-Jul-08 2:17
ajtunbridge2-Jul-08 2:17 
AnswerRe: File copying, byte by byte, w/progress bar Pin
Anthony Mushrow2-Jul-08 2:41
professionalAnthony Mushrow2-Jul-08 2:41 
GeneralRe: File copying, byte by byte, w/progress bar Pin
ajtunbridge2-Jul-08 3:05
ajtunbridge2-Jul-08 3:05 
AnswerRe: File copying, byte by byte, w/progress bar Pin
Spacix One2-Jul-08 6:08
Spacix One2-Jul-08 6:08 
GeneralRe: File copying, byte by byte, w/progress bar Pin
Anthony Mushrow2-Jul-08 6:11
professionalAnthony Mushrow2-Jul-08 6:11 
GeneralRe: File copying, byte by byte, w/progress bar Pin
ajtunbridge3-Jul-08 0:45
ajtunbridge3-Jul-08 0:45 
QuestionMS Visual Studio compiling [modified] Pin
ALAQUNAIBI2-Jul-08 1:14
ALAQUNAIBI2-Jul-08 1:14 
AnswerRe: MS Visual Studio compiling Pin
leppie2-Jul-08 1:34
leppie2-Jul-08 1:34 
JokeRe: MS Visual Studio compiling Pin
User 66582-Jul-08 3:55
User 66582-Jul-08 3:55 
GeneralRe: MS Visual Studio compiling Pin
Pete O'Hanlon2-Jul-08 10:13
mvePete O'Hanlon2-Jul-08 10:13 
AnswerRe: MS Visual Studio compiling Pin
Simon P Stevens2-Jul-08 4:16
Simon P Stevens2-Jul-08 4:16 
QuestionSelection of Treeview node during page load Pin
shehezada2-Jul-08 1:03
shehezada2-Jul-08 1:03 
AnswerRe: Selection of Treeview node during page load Pin
ajtunbridge2-Jul-08 2:33
ajtunbridge2-Jul-08 2:33 
GeneralRe: Selection of Treeview node during page load Pin
shehezada2-Jul-08 22:19
shehezada2-Jul-08 22:19 
QuestionHow to prevent user to go back to desktop? Pin
bug_aonz2-Jul-08 0:58
bug_aonz2-Jul-08 0:58 

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.