title: How to fill a dataset from a stored procedure using MySql and Mono
body: <p>I am trying to fill a dataset with the result of a stored procedure using MySql and Mono.</p>
  
  <p>The stored procedure takes in some values, creates a new row in a table and then selects some rows.</p>
  
  <p>When I try this I get back an empty dataset and my database does not have any new records.
  I have checked the basics:</p>
  
  <ul>
  <li>The Database is running and I can connect.</li>
  <li>The stored procedure name and parameter names are correct.</li>
  <li>The parameter types are correct.</li>
  <li>The stored procedure works correctly from an sql command line.</li>
  </ul>
  
  <p>If I don't use a stored procedure and set the command.commandtext to some sql it returns a dataset with data.</p>
  
  <p>Here is a code snippet that showing what I am trying to do.</p>
  
  <pre><code>ConnectionStringSettings connectionStringSettings = ConfigurationManager.ConnectionStrings [this.provider];
  DbProviderFactory factory = DbProviderFactories.GetFactory (connectionStringSettings.ProviderName);
  
  using(DbConnection connection = factory.CreateConnection())
  {
      connection.ConnectionString = connectionStringSettings.ConnectionString;
      connection.Open();
  
      using(DbCommand command = connection.CreateCommand()) {
          command.CommandText = "createUser";
          command.CommandType = CommandType.StoredProcedure;
  
          dbParameter dbParameter = factory.CreateParameter();
          dbParameter.ParameterName = "@name";
          dbParameter.Value = "Fred.Smith";
          command.Parameters.Add(dbParameter);
  
          DataSet dataset = new DataSet();
          DbDataAdapter adaptor = factory.CreateDataAdapter();
          adaptor.SelectCommand = command;
          adaptor.Fill(dataset);
  
          //This is all ways empty
          return dataset;
      }
  }
  </code></pre>