Kratoswoo 0 Newbie Poster

I am using linq for a log in and out type thing.

Want to know if there is a way to grab the ID of a row that the persons username is under....
Have 3 tables with 2 primary keys in the 3rd table.
Want to save the ID from those 2 into the 3rd one so.....
"Puts in username (blahblah) hits login and it logs you in grabbing the 2 IDs" "Hits logout and saves the ID to a 3rd table"

So far have

var result = (from l in **.L**
                              where l.**ID == (C**.E***.Max(u1 => u1.*ID))
                              select new
                               {
                                   UserName = l.E***.UserName,
                                   *ID = l.*ID
                               }).FirstOrDefault();

                *.SubmitChanges();
                *.L*.InsertOnSubmit(result);

If that makes any sense..

Thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.