http://blog.csdn.net/q107770540/article/details/5724013

 

public string GetStudata()
{
string name = Request.QueryString["name"];
string sex = Request.QueryString["sex"];
string qurstr = "";
var stus = from p in data.Student
select p;
if (!string.IsNullOrEmpty(name) && sex != "Choose..." && sex != null)
{
stus = stus.Where(q=>q.name.Contains(name)&&q.sex==sex);
}
if (string.IsNullOrEmpty(name) && sex != "Choose..." && sex != null)
{
stus = stus.Where(q => q.sex == sex);
}
if (!string.IsNullOrEmpty(name) && sex == "Choose..." && sex!=null)
{
stus = stus.Where(q => q.name.Contains(name));
}

 

相关文章:

  • 2021-11-30
  • 2022-12-23
  • 2022-12-23
  • 2021-05-28
  • 2021-04-21
  • 2022-12-23
  • 2022-12-23
  • 2021-10-31
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-26
  • 2022-12-23
  • 2021-07-31
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案