Click here to Skip to main content
15,902,939 members
Home / Discussions / C#
   

C#

 
GeneralRe: running the Procedure Pin
Mircea Puiu6-Jan-08 23:47
Mircea Puiu6-Jan-08 23:47 
GeneralRe: running the Procedure Pin
J4amieC6-Jan-08 23:50
J4amieC6-Jan-08 23:50 
GeneralRe: running the Procedure Pin
Mircea Puiu6-Jan-08 23:56
Mircea Puiu6-Jan-08 23:56 
GeneralRe: running the Procedure Pin
J4amieC6-Jan-08 23:49
J4amieC6-Jan-08 23:49 
GeneralRe: running the Procedure Pin
tasumisra7-Jan-08 0:05
tasumisra7-Jan-08 0:05 
GeneralRe: running the Procedure Pin
Steppo7-Jan-08 0:44
Steppo7-Jan-08 0:44 
GeneralRe: running the Procedure Pin
tasumisra7-Jan-08 1:22
tasumisra7-Jan-08 1:22 
GeneralRe: running the Procedure [modified] Pin
Steppo7-Jan-08 2:30
Steppo7-Jan-08 2:30 
SqlConnection conn = new SqlConnection("CONNECTION HERE");
SqlCommand cmd = new SqlCommand();

cmd.Connection = conn;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "sp_abc";

//Create the first parameter
SqlParameter firstParam = new SqlParameter("P_Id", SqlDbType.Int);
firstParam.Value = 0; //Place your variable
firstParam.Direction = ParameterDirection.Input;

cmd.Parameters.Add(firstParam); //Parameter 1

//Create the second parameter
SqlParameter secondParam = new SqlParameter("ResultRS", SqlDbType.Variant);
secondParam.Direction = ParameterDirection.Output;

cmd.Parameters.Add(secondParam); //Parameter 2

int count = cmd.ExecuteNonQuery();

Console.WriteLine(secondParam.Value.ToString());


This is correct now, secondParam.Value and you read the value

News at http://support.microsoft.com/kb/308621[^]

modified on Monday, January 07, 2008 8:36:36 AM

QuestionDeleting from database Pin
Derick Magagula6-Jan-08 22:56
Derick Magagula6-Jan-08 22:56 
GeneralRe: Deleting from database Pin
N a v a n e e t h6-Jan-08 23:05
N a v a n e e t h6-Jan-08 23:05 
GeneralLast Day of Current Month Pin
sami_pak6-Jan-08 21:26
sami_pak6-Jan-08 21:26 
GeneralRe: Last Day of Current Month Pin
N a v a n e e t h6-Jan-08 21:45
N a v a n e e t h6-Jan-08 21:45 
GeneralWrong forum. Pin
Pete O'Hanlon6-Jan-08 22:37
mvePete O'Hanlon6-Jan-08 22:37 
AnswerRe: Last Day of Current Month Pin
GuyThiebaut6-Jan-08 23:10
professionalGuyThiebaut6-Jan-08 23:10 
GeneralAny query about northwind? [modified] Pin
omegazafer6-Jan-08 21:13
omegazafer6-Jan-08 21:13 
GeneralWrong forum Pin
Pete O'Hanlon6-Jan-08 22:47
mvePete O'Hanlon6-Jan-08 22:47 
GeneralRe: Wrong forum Pin
omegazafer6-Jan-08 23:05
omegazafer6-Jan-08 23:05 
GeneralRe: Wrong forum Pin
Pete O'Hanlon7-Jan-08 1:18
mvePete O'Hanlon7-Jan-08 1:18 
GeneralInsert TXT data into SQL database Pin
minniemooo6-Jan-08 21:04
minniemooo6-Jan-08 21:04 
GeneralRe: Insert TXT data into SQL database Pin
N a v a n e e t h6-Jan-08 21:25
N a v a n e e t h6-Jan-08 21:25 
GeneralRe: Insert TXT data into SQL database Pin
J4amieC6-Jan-08 22:20
J4amieC6-Jan-08 22:20 
Generallambda or anonymous delegate [modified] Pin
Roger Alsing6-Jan-08 20:55
Roger Alsing6-Jan-08 20:55 
GeneralGenerating Reports Pin
sami_pak6-Jan-08 20:26
sami_pak6-Jan-08 20:26 
GeneralRe: Generating Reports Pin
N a v a n e e t h6-Jan-08 20:27
N a v a n e e t h6-Jan-08 20:27 
Generalfilereading problem Pin
chanzeb6-Jan-08 20:10
chanzeb6-Jan-08 20:10 

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.