<p>I'm trying to add parameters to an objectDataSource at runtime like this:</p>

<pre><code>        Parameter objCustomerParameter = new Parameter("CustomerID", DbType.String, customerID);
        Parameter objGPDatabaseParameter = new Parameter("Database", DbType.String, gpDatabase);

        //set up object data source parameters
        objCustomer.SelectParameters["CustomerID"] = objCustomerParameter;
        objCustomer.SelectParameters["Database"] = objGPDatabaseParameter;
</code></pre>

<p>At what point in the objectDataSource lifecycle should these parameters be added (what event)?  Also, some values are coming from a master page property (which loads <em>after</em> the page_load of the page containing the objectDataSource).</p>

Add as early as possible; at the
```
PreInit
```
event.  This is part of initialization so should be done there.
See the
ASP.NET Page Life Cycle Overview
for more information.