Link to home
Start Free TrialLog in
Avatar of Mohammad Alsolaiman
Mohammad AlsolaimanFlag for Saudi Arabia

asked on

Check if record already exist using LINQ to sql

HI:
I'm using LINQ to sql with c#
I have a text box on a web page , after entering a value to that box
I need to validate whither if this value exist in myTable or not
Var xmyTable = (from ymyTable in objDataContext.myTables
                              Select new 
                             {
                               ymyTable.myCode
                              ymyTable.myNmae
                             }

Open in new window

please help
ASKER CERTIFIED SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mohammad Alsolaiman

ASKER

i couldn't understand this line of code!
select true)FirstOrDefault();

Open in new window

would you please explane
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks a lot, and very sorry for late