Getting "Terrasoft.Common.InvalidObjectStateException: Specify data type for parameter "P1" with null value." error
Since a few days , I get this error : "Terrasoft.Common.InvalidObjectStateException: Specify data type for parameter "P1" with null value." when calling a select command in my script tasks. The way is call them is like this :
public Guid Get_bankaccountid(string bankaccount)
{
Guid bankaccountid = new Guid();
string ourBankAccountTable = "UsrOurBankaccount";
var userconnection = UserConnection.Current;
var entitySchemaManager = userconnection.EntitySchemaManager;
var entitySchema_ourbank = entitySchemaManager.GetInstanceByName(ourBankAccountTable);
var bankrec = new QueryParameter(bankaccount);
var select_bank = new Select(userconnection)
.Column("Id")
.Column("UsrName")
.Column("UsrActive")
.From(ourBankAccountTable)
.Where("UsrName").IsEqual(bankrec)
as Select;
using (DBExecutor dbExecutor_bank = userconnection.EnsureDBConnection())
{
using (System.Data.IDataReader reader = select_bank.ExecuteReader(dbExecutor_bank))
{
if (reader.Read())
{
if ((bool)reader["UsrActive"])
{
bankaccountid = (Guid)reader["Id"];
}
}
}
}
return bankaccountid;
}
This code has run for months, and is now causing problems in my clouded deployments. On my local system however, it runs perfectly. Has anyone any idea what has changed?
Greetings,
Vincent
Like