We Recommend

Accelerated C# 2008 Accelerated C# 2008
This book is both a rapid tutorial and a permanent reference. You’ll quickly master C# syntax while learning how the CLR simplifies many programming tasks. You’ll also learn best practices that ensure your code will be efficient, reusable, and robust. Why spend months or years discovering the best ways to design and code C# when this book will show you how to do things the right way, right from the start?


Posted By

rengber on 03/21/07


Tagged

sql StoredProc ADONet


Versions (?)


Get the Return Value from an SQL Stored Procedure


Published in: C# 


  1. parameters[1] = new SqlParameter("@Return_Value", SqlDbType.Int);
  2. parameters[1].Value = -1;
  3. parameters[1].Direction = ParameterDirection.ReturnValue;
  4.  
  5. if(Int32.Parse(parameters[1].Value.ToString()) != -1)
  6. {
  7. //Success
  8. }

Report this snippet 

You need to login to post a comment.