Reputation: 1471
Hi all I am creating update functionality with objectdatasource. Actually it was working fine till i have not changed UpdateMethod's parameter. I have two parameter in it but it expecting three parameters. Giving me below error.
ObjectDataSource 'ODSConfig' could not find a non-generic method 'UpdatePagedDataSet' that has parameters: CONFIG_VALUE, configKey, configValue.
C# Code:
protected void ODSConfig_Updating(object sender, ObjectDataSourceMethodEventArgs e)
{
TextBox val = (TextBox)GVConfig.Rows[GVConfig.EditIndex].Cells[2].Controls[0];
Parameter objKeyConfig = new Parameter("configKey", DbType.String, GVConfig.Rows[GVConfig.EditIndex].Cells[1].Text);
Parameter objKeyValueConfig = new Parameter("configValue", DbType.String, val.Text);
e.InputParameters["configKey"] = objKeyConfig.DefaultValue;
e.InputParameters["configValue"] = objKeyValueConfig.DefaultValue;
}
Upvotes: 0
Views: 843
Reputation: 11
After Adding the Parameters just add ODSConfig.Update()
;
After this your code will look like this :
protected void ODSConfig_Updating(object sender, ObjectDataSourceMethodEventArgs e)
{
TextBox val = (TextBox)GVConfig.Rows[GVConfig.EditIndex].Cells[2].Controls[0];
Parameter objKeyConfig = new Parameter("configKey", DbType.String, GVConfig.Rows[GVConfig.EditIndex].Cells[1].Text);
Parameter objKeyValueConfig = new Parameter("configValue", DbType.String, val.Text);
e.InputParameters["configKey"] = objKeyConfig.DefaultValue;
e.InputParameters["configValue"] = objKeyValueConfig.DefaultValue;
ODSConfig.Update();
}
thanks
Upvotes: 1