tags:

views:

49

answers:

2

hi.. i have a table "Users" in database. it have three colu mns

Id (bigint) PK Username (varchar) Password (varchar)

i want to get user based on id

i am u sing this code bt it is giving me error

     using (var db = new UsersDataContext())
                {

// ERROR :: Cannot implicitly convert type 'long' to 'bool'
                    MUser user = from u in db.MUsers
                                 where u.Id= 1 
                                 select u;            

                }

how to solve this??

A: 
from u in db.MUsers
where u.Id == 1   // notice ==
select u
leppie
oooooooops. a small mistake :)
Mohsan
A: 

You need to use

where u.Id == 1
womp