SQL Output Parameters


/ Published in: C#
Save to your folder(s)



Copy this code and paste it in your HTML
  1. using System.Data;
  2. using System.Data.SqlClient;
  3.  
  4. if (sqlConn.State == System.Data.ConnectionState.Closed)
  5. _sqlConn.Conn;
  6.  
  7. bool suc = false;
  8.  
  9. SqlCommand insertRow = new SqlCommand(_command, _connString);
  10. insertRow.CommandType = System.Data.CommandType.StoredProcedure;
  11.  
  12. SqlParameter para = new SqlParameters("@DONE". SqlDbType.Bit);
  13. paraDone.Direction = ParameterDirection.Output;
  14.  
  15. insertRow.Parameters.AddWithValue("Number", no);
  16. insertRow.Parameters.Add(para);
  17. insertRow.ExecuteNonQuery();
  18.  
  19. suc = (bool)para.Value;

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.