title: The stored procedure doesn't exist when calling SqlCommandBuilder.DeriveParameters
body: <p>I'm tring to get the parameters from a stored procedure but I am getting the error of </p>
  
  <pre><code>The stored procedure 'Generic.proc_UpdateGenericCatalog' doesn't exist.
  </code></pre>
  
  <p>The namespace Generic. is causing the error but I do not know which setting I should use to get beyond this error.</p>
  
  <p><strong>--My Procedure--</strong></p>
  
  <pre><code>ALTER proc [Generic].[proc_UpdateGenericCatalog]
  @UserID           UNIQUEIDENTIFIER,
  @Name             VARCHAR(30),
  @SupplierName     VARCHAR(30),
  @SupplierEmail    VARCHAR(50),
  @SupplierPhone    VARCHAR(12),
  @GenericCatalogID INT
  AS
  
  UPDATE [Generic].[GenericCatalog]
        SET [UserID] = @UserID
           ,[Name] = @Name
           ,[SupplierName] =  @SupplierName
           ,[SupplierEmail] = @SupplierEmail
           ,[SupplierPhone] = @SupplierPhone
  
   WHERE ID = @GenericCatalogID
  </code></pre>
  
  <p><strong>--The C# code I'm using to get the parameter info--</strong></p>
  
  <p><strong>--The error is right here</strong> <code>SqlCommandBuilder.DeriveParameters(cmd);</code></p>
  
  <p>How should I alter my code below so that I can get the .DeriveParameter info?</p>
  
  <pre><code>    private static SqlParameter[] DiscoverParameters(string connectionString, string spName)
      {
           SqlCommand cmd = null;
           SqlParameter[] discoveredParameters = null;
          try
          {
              using (SqlConnection conn = new SqlConnection())
              { 
  
                  conn.ConnectionString = connectionString; 
                  conn.Open();
  
                  cmd = new SqlCommand(spName, conn);
                  cmd.CommandType = CommandType.StoredProcedure;
  
                  SqlCommandBuilder.DeriveParameters(cmd);
                  conn.Close();
  
                  discoveredParameters = new SqlParameter[cmd.Parameters.Count];
  
                  cmd.Parameters.CopyTo(discoveredParameters, 0);
  
                  foreach (SqlParameter discoveredParameter in discoveredParameters)
                  {
                      discoveredParameter.Value = DBNull.Value;
                  }
                  cmd.Dispose();
              }
          }
          catch (Exception) { throw; }
          return discoveredParameters;
      }
  </code></pre>