Click here to Skip to main content
15,888,733 members
Home / Discussions / C#
   

C#

 
AnswerRe: Looking for a specific regex Pin
PIEBALDconsult9-Jan-13 3:42
mvePIEBALDconsult9-Jan-13 3:42 
QuestionOrder execution sequence Pin
vanikanc8-Jan-13 10:32
vanikanc8-Jan-13 10:32 
AnswerRe: Order execution sequence Pin
YENSIX8-Jan-13 11:17
YENSIX8-Jan-13 11:17 
GeneralRe: Order execution sequence Pin
vanikanc8-Jan-13 14:36
vanikanc8-Jan-13 14:36 
GeneralRe: Order execution sequence Pin
vanikanc9-Jan-13 5:24
vanikanc9-Jan-13 5:24 
GeneralRe: Order execution sequence Pin
Pete O'Hanlon9-Jan-13 5:28
mvePete O'Hanlon9-Jan-13 5:28 
GeneralRe: Order execution sequence Pin
vanikanc9-Jan-13 9:41
vanikanc9-Jan-13 9:41 
GeneralRe: Order execution sequence Pin
YENSIX10-Jan-13 10:56
YENSIX10-Jan-13 10:56 
Continue to use the ExecuteReader() ...

To get the output values, you need to have first read from the DataReader and then closed it. In the case of the sample, you must have the read after the "using statement" (the using statement will automatically close the data reader), or you must force the DataReader closed before proceeding...

OPTION 1:
C#
using ( SqlDataReader dr = cmd.executeReader() ) {
  while ( dr.Read() ) {
    // Read all row values here
  }
}

// Now you can read the output value
int ouputValue = (int) outParam.Value;


OPTION 2:

C#
SqlDataReader dr = cmd.ExecuteReader();

while ( dr.Read() ) {
  // Read all row values here
}
dr.Close();

// Now you can read the output value
int ouputValue = (int) outParam.Value;


Does that help?
GeneralRe: Order execution sequence Pin
vanikanc14-Jan-13 9:45
vanikanc14-Jan-13 9:45 
QuestionCalling Console project Pin
PozzaVecia8-Jan-13 9:08
PozzaVecia8-Jan-13 9:08 
AnswerRe: Calling Console project Pin
PIEBALDconsult8-Jan-13 9:17
mvePIEBALDconsult8-Jan-13 9:17 
GeneralRe: Calling Console project Pin
SledgeHammer018-Jan-13 9:31
SledgeHammer018-Jan-13 9:31 
GeneralRe: Calling Console project Pin
PIEBALDconsult8-Jan-13 11:05
mvePIEBALDconsult8-Jan-13 11:05 
AnswerRe: Calling Console project Pin
PozzaVecia8-Jan-13 9:23
PozzaVecia8-Jan-13 9:23 
GeneralRe: Calling Console project Pin
SledgeHammer018-Jan-13 9:31
SledgeHammer018-Jan-13 9:31 
GeneralRe: Calling Console project Pin
PIEBALDconsult17-Jan-13 12:45
mvePIEBALDconsult17-Jan-13 12:45 
GeneralRe: Calling Console project Pin
Dave Kreskowiak8-Jan-13 9:44
mveDave Kreskowiak8-Jan-13 9:44 
GeneralRe: Calling Console project Pin
PozzaVecia8-Jan-13 10:41
PozzaVecia8-Jan-13 10:41 
GeneralRe: Calling Console project Pin
Pete O'Hanlon8-Jan-13 11:28
mvePete O'Hanlon8-Jan-13 11:28 
GeneralRe: Calling Console project Pin
Dave Kreskowiak8-Jan-13 12:41
mveDave Kreskowiak8-Jan-13 12:41 
GeneralRe: Calling Console project Pin
PIEBALDconsult8-Jan-13 13:40
mvePIEBALDconsult8-Jan-13 13:40 
GeneralRe: Calling Console project Pin
BobJanova10-Jan-13 1:29
BobJanova10-Jan-13 1:29 
QuestionC# Reading Excel resource file Pin
Member 97041538-Jan-13 5:48
Member 97041538-Jan-13 5:48 
AnswerRe: C# Reading Excel resource file Pin
Richard MacCutchan8-Jan-13 6:18
mveRichard MacCutchan8-Jan-13 6:18 
GeneralRe: C# Reading Excel resource file Pin
eferreyra8-Jan-13 6:43
eferreyra8-Jan-13 6:43 

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.