Neil
0
Q:

check if an element is in data base linq lambda

 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
}  
0

New to Communities?

Join the community