这段代码:
string SidFinch = "Unknown SidFinch";
String sql = @"SELECT SidFinch
FROM PlatypusDuckbillS
WHERE PlatypusSTARTDATE = :Duckbilldate AND
DuckbillID = :Duckbillid";
try {
using (OracleCommand ocmd = new OracleCommand(sql, oc)) {
ocmd.Parameters.Add("Duckbilldate", DuckbillDate);
ocmd.Parameters.Add("Duckbillid", DuckbillID);
SidFinch = ocmd.ExecuteScalar().ToString();
}
...在“ExecuteScalar”行上失败。它没有找到任何东西(我通过的 ID 没有匹配的记录),但这不应该导致这个问题,不是吗?