【发布时间】:2014-04-30 19:21:18
【问题描述】:
好的,这是我的代码
protected void TextBox1_TextChanged(object sender, EventArgs e)
{
if (bll.MainEnq_Stu_Name(en) != null)
{
Label9.Text = bll.MainEnq_Stu_Name(en).ToString();
}
else
{
Label9.Text = "No Records Found!";
}
}
这里是业务逻辑层的查询。
//MainEnquiry.aspx panel1
public object MainEnq_Stu_Name(EntityLayer.Entity en)
{
return dll.GetSingleValue("select name from studentinfo where mobile=" + en.mainEnq_Stu_Mobile+"and dob is not null");
}
现在我想做的是在上面的代码中为 if 迭代添加一个更多功能。
that is if mobile is null print "no records found".
and if dob is not null print "this user already exists"
【问题讨论】:
标签: c# asp.net sql-server if-statement 3-tier