Click here to Skip to main content
15,881,882 members
Home / Discussions / C#
   

C#

 
AnswerRe: wpf OR windows forms ??? Pin
PIEBALDconsult16-Jan-13 11:16
mvePIEBALDconsult16-Jan-13 11:16 
QuestionWMI causing Access is denied Pin
vanikanc16-Jan-13 3:36
vanikanc16-Jan-13 3:36 
AnswerRe: WMI causing Access is denied Pin
Dave Kreskowiak16-Jan-13 3:41
mveDave Kreskowiak16-Jan-13 3:41 
GeneralRe: WMI causing Access is denied Pin
vanikanc16-Jan-13 3:56
vanikanc16-Jan-13 3:56 
GeneralRe: WMI causing Access is denied Pin
vanikanc16-Jan-13 4:31
vanikanc16-Jan-13 4:31 
GeneralRe: WMI causing Access is denied Pin
Dave Kreskowiak16-Jan-13 4:55
mveDave Kreskowiak16-Jan-13 4:55 
GeneralRe: WMI causing Access is denied Pin
Dave Kreskowiak16-Jan-13 4:57
mveDave Kreskowiak16-Jan-13 4:57 
QuestionProblem getting data from a stored procedure (Oracle) Pin
GDavy16-Jan-13 3:11
GDavy16-Jan-13 3:11 
On the Oracle DB there's a stored proc defined like:

SQL
PROCEDURE pGetHashes ( iFrom IN NUMBER, iTo IN NUMBER, sHash1 OUT CHAR, sHash2 OUT CHAR );


When I call this procedure from within my app, I only get a value for the sHash2 parameter. The value of the sHash1 parameter is always null. (Running the same stored proc from sqldeveloper gives a result for both hash values.)
Underneath I have added the code which I use to call the stored proc. Does anybody see anything I might have done wrong?

C#
int iFrom = 0;
int iTo = 1000;
using (IDbCommand command = dbConnection.CreateCommand())
{
    OracleCommand orclCommand = command as OracleCommand;
    orclCommand.CommandText = "pGetHashes";
    orclCommand.CommandType = CommandType.StoredProcedure;

    orclCommand.Parameters.Clear();
    orclCommand.Parameters.Add("iFrom", OracleDbType.Int32, iFrom, ParameterDirection.Input);
    orclCommand.Parameters.Add("iTo", OracleDbType.Int32, iTo, ParameterDirection.Input);

    OracleParameter orclParam = new OracleParameter("sHash1", OracleDbType.Char, 100);
    orclParam.Direction = ParameterDirection.Output;
    orclCommand.Parameters.Add(orclParam);
    orclParam = new OracleParameter("sHash2", OracleDbType.Char, 100);
    orclParam.Direction = ParameterDirection.Output;
    orclCommand.Parameters.Add(orclParam);

    orclCommand.BindByName = true;

    orclCommand.ExecuteNonQuery();

    // after this the orclCommand.Parameters["sHash1"].Value is always null.
    // the orclCommand.Parameters["sHash2"].Value has the correct value.
}


For extra documentation. Running the following PLSQL from within sqldeveloper results in both a value for Hash1 and Hash2:

SQL
SET SERVEROUTPUT ON;
DECLARE 
sHash1 CHAR(67);
sHash2 CHAR(67);
nFrom NUMBER := 0;
nTo NUMBER := 1000;
BEGIN

pGetHashes( nFrom, nTo, sHash1, sHash2 );

dbms_output.put_line('Hash1: '|| sHash1);
dbms_output.put_line('Hash2: '|| sHash2);
END;


Thanks for any light you can shed on this problem.

modified 17-Jan-13 2:00am.

AnswerRe: Problem getting data from a stored procedure (Oracle) Pin
micke.andersson28-Jan-13 3:39
micke.andersson28-Jan-13 3:39 
QuestionC#, Windows 8 UAC, and registry edit Pin
clover4leaves16-Jan-13 2:46
clover4leaves16-Jan-13 2:46 
AnswerRe: C#, Windows 8 UAC, and registry edit Pin
jschell16-Jan-13 9:19
jschell16-Jan-13 9:19 
GeneralRe: C#, Windows 8 UAC, and registry edit Pin
clover4leaves16-Jan-13 14:00
clover4leaves16-Jan-13 14:00 
GeneralRe: C#, Windows 8 UAC, and registry edit Pin
Jonathan C Dickinson17-Jan-13 2:00
Jonathan C Dickinson17-Jan-13 2:00 
GeneralRe: C#, Windows 8 UAC, and registry edit Pin
clover4leaves17-Jan-13 4:09
clover4leaves17-Jan-13 4:09 
QuestionCombo box selection event Pin
Trishal15-Jan-13 19:59
Trishal15-Jan-13 19:59 
AnswerRe: Combo box selection event Pin
Abhinav S15-Jan-13 21:38
Abhinav S15-Jan-13 21:38 
AnswerRe: Combo box selection event Pin
Trishal15-Jan-13 22:37
Trishal15-Jan-13 22:37 
GeneralRe: Combo box selection event Pin
Richard MacCutchan15-Jan-13 22:50
mveRichard MacCutchan15-Jan-13 22:50 
GeneralRe: Combo box selection event Pin
Trishal15-Jan-13 23:22
Trishal15-Jan-13 23:22 
GeneralRe: Combo box selection event Pin
Richard MacCutchan15-Jan-13 23:35
mveRichard MacCutchan15-Jan-13 23:35 
GeneralRe: Combo box selection event Pin
masalahi22-Jan-13 11:24
masalahi22-Jan-13 11:24 
GeneralRe: Combo box selection event Pin
V.15-Jan-13 23:00
professionalV.15-Jan-13 23:00 
QuestionReading metadata from exported types with .net framework 3.5 Pin
Danzy8315-Jan-13 12:18
Danzy8315-Jan-13 12:18 
Answer[Solved] Reading metadata from exported types with .net framework 3.5 Pin
Danzy8315-Jan-13 12:52
Danzy8315-Jan-13 12:52 
QuestionNLog question Pin
vanikanc15-Jan-13 10:16
vanikanc15-Jan-13 10:16 

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.