Monday, February 21, 2011

Calling stored procedure ignoring output parameters

I need to call MySql procedure as a plain text. Procedure has output parameter.
I'm not interested in returned data. What do I need to pass as output parameter to ignore it?

PS:

I know that using of SqlParameters is good and safe, but it is not my case.

From stackoverflow
  • Is this what you are looking for?

    SqlConnection mySqlConnection = ConnectDB();
    SqlCommand mySqlCommand = mySqlConnection.CreateCommand();
    mySqlCommand.CommandText =
       @" 
          SQL QUERY HERE
       ";
    mySqlConnection.Open();
    mySqlCommand.ExecuteNonQuery();
    mySqlConnection.Close();
    
    Orsol : Not exact. I need to call "MyStoredProcedure @outputParam"

0 comments:

Post a Comment