我想檢查兩個表中的用戶名可用性如何執行此操作請幫助。檢查兩個表中的用戶名可用性c#
a = (from n in dbobj.stores
where n.st_UserName == storeuname
select n.st_id).Single();
return true;
我試圖在同一時間檢查,如:
a = (from n in dbobj.stores && dbobj.customer
where n.st_UserName == storeuname or n.cu_UserName == storeuname
select n.st_id).Single();
return true;
幫助我,如果我在做錯誤的方式事情。
可以請你告訴我,我怎麼能在數據庫 – user3757908
的兩個表檢查用戶名這不回答這個問題。另外,爲什麼在Any()給你一個'bool'響應時使用Count()'? – DavidG
好點。我用'Any()'替換了'Count()'。 –