Answers for "check if an element is in data base linq lambda"

0

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
}
Posted by: Guest on September-28-2020

Code answers related to "check if an element is in data base linq lambda"

Browse Popular Code Answers by Language