我几天来一直在努力解决这个问题。 至于我可以tel,我已经声明了一个OracleCommand对象的实例,它允许我使用" mySearch.ExecuteScalar();"
string constr = "Connection String here";
bool result = false;
OracleConnection newConn = new OracleConnection(constr);
try
{
string query = "SELECT * FROM " + table + " WHERE " + custNm + " = '" + nm + "'";
OracleCommand mySearch = new OracleCommand(query, newConn);
newConn.Open();
decimal count;
count = (decimal)mySearch.ExecuteScalar();
if (count >= 1)
{
newConn.Close();
result = true;
}
}
finally
{
newConn.Close();
}
return result;
}
任何帮助将不胜感激。 提前致谢。