Click here to Skip to main content
15,913,854 members
Home / Discussions / C#
   

C#

 
AnswerRe: Socket programming Pin
Thomas Daniels9-Jan-13 6:47
mentorThomas Daniels9-Jan-13 6:47 
QuestionLooking for a specific regex Pin
Dennis Bork8-Jan-13 21:31
Dennis Bork8-Jan-13 21:31 
AnswerRe: Looking for a specific regex Pin
Pete O'Hanlon8-Jan-13 22:27
mvePete O'Hanlon8-Jan-13 22:27 
AnswerRe: Looking for a specific regex Pin
savbace8-Jan-13 23:49
savbace8-Jan-13 23:49 
AnswerRe: Looking for a specific regex Pin
lmoelleb9-Jan-13 0:12
lmoelleb9-Jan-13 0:12 
GeneralRe: Looking for a specific regex Pin
Dennis Bork9-Jan-13 3:26
Dennis Bork9-Jan-13 3:26 
AnswerRe: Looking for a specific regex Pin
thewazz9-Jan-13 3:38
professionalthewazz9-Jan-13 3:38 
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 

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.