1
大家好我正在用objectdatasource创建更新功能。实际上它工作正常,直到我没有更改UpdateMethod的参数。我有两个参数,但它期待三个参数。给我下面的错误。Objectdatasource更新问题
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;
}
你的错误消息说,你需要在你的更新方法三个参数。您错过了CONFIG_VALUE参数。 –
@BogdanRotund:我不想要第三个参数。即使在业务逻辑中,我只有两个参数。 – user968441
检查您的UpdatePagedDataSet具有多少个参数。 –