📜  检查元素是否在数据库中 linq lambda - 无论代码示例

📅  最后修改于: 2022-03-11 14:56:46.911000             🧑  作者: Mango

代码示例1
string s = textBox1.text;
var xmyTable = (from ymyTable in objDataContext.myTables where ymyTable.myName == s
                  Select new {ymyTable.myCode,ymyTable.myNmae}).FirstorDefault();
if(xmyTable.Count>0)
{
//your logic for record found.
} 
else
{
//your logic for record not found
}