Click here to Skip to main content
15,879,348 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to get the Emp_Id's


C#
public bool checkid(string empcode)
        {


            bool flag = false;
            var empl = from emp in taxEntity.EXDBs
                       where emp.Emp_Id == empCode
                       select emp;
            if (exdb.Emp_Id == empcode)
                flag = true;

            return flag;
        }


EXDB table values not getting how to get the Emp numbers.
show in null.


how to get Emp_Id's
Posted
Updated 28-Jun-12 8:16am
v4
Comments
Rahul Rajat Singh 28-Jun-12 8:16am    
Not clear. what exactly is the question?
Abhinav S 28-Jun-12 8:17am    
Your question is not clear. What exactly do you need to do?
Tim Corey 28-Jun-12 8:29am    
You are going to need to explain what you are trying to accomplish, as well as what you believe this code is currently accomplishing. Right now it looks like your linq statement never gets used and you are referencing variables we don't see declared.
AmitGajjar 28-Jun-12 8:53am    
Use green "Improve question" link to change your question detail.

Don't you just mean something like this:
C#
public bool checkid(string empcode)
{
  return taxEntity.EXDBs.Any(emp => emp.Emp_Id == empcode);
}


Good luck!
 
Share this answer
 
Hi,
You can with the above post or else you can place your code in try catch block where you can catch the exception

Thanks
www.alacraft.com.au
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900