asp.net sql查询返回空值 怎么能不报错?
例如:string yhlb_str;
yhlb_str="select yhlb from WebUser.DBO.YHZC WHERE ZH='"+@userId+"'";
SqlCommand cmd=new SqlCommand(yhlb_str,this.user_SqlConnection);
this.user_SqlConnection.Open();
yhlb = cmd.ExecuteScalar().ToString();
this.user_SqlConnection.Close();