1st of all store the textbox's value in a string and retrieve value from database matching that sting. here i am taking name as the textbox's value.
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)
{
}
else
{
}