views:

63

answers:

1
protected void objUpdating(object sender, ObjectDataSourceMethodEventArgs e)
{
    e.InputParameters.Add("update_name", "xxx");            
 }

Hi, I am trying to make Update method for ObjectDataSource, which has argument "update_name" but adding parameter to collection using add method throws an exception of dictionary ( key value ) is read only any thougths? thank you

+1  A: 

You cannot use Add method as ObjectDataSource has already added a parameter to the collection.

Try

e.InputParameters["update_name"]= "xxx";

that will work

josephj1989
thanks, but unfortunately it doesn't worki am creating objectdatasource object programmaticaly in Page_Init, can that be a problem?
can you post your code
josephj1989