我写了这个SQL查询:如果条件与空结果查询
SqlCommand cmd2 = new SqlCommand();
cmd2.Connection = new SqlConnection(Class1.CnnStr);
cmd2.CommandText = "SELECT MAX(Code) FROM Table WHERE [email protected] ";
cmd2.Connection.Open();
cmd2.Parameters.AddWithValue("@Number", Hidden_txt.Text);
cmd2.ExecuteNonQuery();
,我想补充一些if条件,如:
if (cmd2.ExecuteScalar()=="Null")
{....}
我怎么能如果条件添加当我的查询没有答案?