I'm trying to add parameters to an objectDataSource at runtime like this:
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;
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 after the page_load of the page containing the objectDataSource).
See Question&Answers more detail:os