(PostgreSQL 9.1,Telerik OpenAccess v2.0.50727,PgAdmin III)。實體框架(Telerik)調用失敗,ExecuteNonQuery返回PostgreSQL存儲過程
我很難從(Telerik)實體框架調用存儲過程。確切的錯誤是:
NpgsqlException was unhandled by user code.
ERROR: 42703: column "cpatient" does not exist.
的Telerik的模板調用是:
public int SaveDx(string cpatient, Object o, Object n)
{
OAParameter parameterCpatient = new OAParameter();
parameterCpatient.ParameterName = "cpatient";
parameterCpatient.Size = -1;
if(cpatient != null)
{
parameterCpatient.Value = cpatient;
}
else
{
parameterCpatient.DbType = DbType.String;
parameterCpatient.Value = DBNull.Value;
}
OAParameter parameterO = new OAParameter();
parameterO.ParameterName = "o";
parameterO.Value = o;
OAParameter parameterN = new OAParameter();
parameterN.ParameterName = "n";
parameterN.Value = n;
int queryResult = this.ExecuteNonQuery("SELECT * FROM \"public\".\"g_savedx\"(cpatient, o, n)", CommandType.Text, parameterCpatient, parameterO, parameterN);
return queryResult;
}
凡的ExecuteNonQuery語句生成錯誤。 PostgreSQL的存儲過程如下:
FUNCTION g_savedx(cpatient character varying, o view_dx, n view_dx)
RETURNS void AS ...
postgreSQL函數已經過測試,可以從pgAdmin正常工作。
那麼列「cpatient」來自哪裏?我究竟做錯了什麼?
TIA