Thanks, Richard. Saying truth, I've already understand where I made a mistake. I anyway want ExecuteScalar to return db error, so I simply added the test is byte for result before casting:
Object sqlResult = ExecuteScalar(sql);
if (!(sqlResult is byte))
{
return sqlResult.ToString();
}
This is the internal module, and WHERE clause is generated programmatically, so I don't see the ability to SQL Injection. Thanks once more. Regards, Gennady
My English is permanently under construction. Be patient !!