求助, ExecuteScalar 的错误.
public int getlistnum(string datestr) {
string sqlstr = "select count(*) from 永远where 时间='" + datestr + "'";
OleDbCommand mycmd = new OleDbCommand(sqlstr, myconn);
if (mycmd.ExecuteScalar() == null) // 提示 "至少一个参数没有被指定值。" 错误, 新学c#,不知道怎么用 ExecuteScalar() 请给予帮助.
{
return 0;
}
else
{
Int32 num = (Int32)mycmd.ExecuteScalar();
return num;
}
}