日期:2014-05-20 浏览次数:20949 次
var Reslute = from TableUser in sc.getDataTable(strSql).AsEnumerable()
where TableUser["UserName"].ToString() == txtUserName.Text && TableUser["Password"].ToString() == txtPassword.Text
select TableUser;
var Reslute = (from TableUser in sc.getDataTable(strSql).AsEnumerable()
where TableUser.Field<string>("UserName") == txtUserName.Text && TableUser.Field<string>("Password") == txtPassword.Text
select TableUser).SingleOrDefault();
if(Reslute !=null)
{
string userName=Reslute.Field<string>("UserName");
//其他的就这么写就OK了
}
var UserName = Result.select(a => a.username)