//创建LINQ查询语句,判断用户名是否存在
var result = from v in ddc.Users
where v.Name==tbUserName.Text.Trim()
select v;
if(result==null) response.write("not exist");
------解决方案-------------------- var result = from v in ddc.Users
where v.Name==tbUserName.Text.Trim()
select v;
if(result.FirstOrDefault()==null) response.write("not exist");