大家好,我正在使用 objectdatasource 创建更新功能。实际上它工作正常,直到我没有更改 UpdateMethod 的参数。我有两个参数,但它需要三个参数。给我以下错误。
ObjectDataSource 'ODSConfig' could not find a non-generic method 'UpdatePagedDataSet' that has parameters: CONFIG_VALUE, configKey, configValue.
C#代码:
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;
}